Whenever we want to store related data like list of books, list of students etc at one place, we use an array. An array not only allows to store related data but to organise it as you like and also quickly access to that data. Array can be effectively manipulated. In PHP, arrays are indexed from 0 and not from 1.
PHP has three types of arrays
Array can be specified in following two different ways
Syntax
This will produce following result
Syntax:
This will produce following result
This can be done using implode() function.
This will produce following result
This can also be done using implode() function but differntly.
This will produce following result
This can be done using array_reverse() function.
This will produce following result
This can be done using array_slice() function.
This will produce following result
This can be done using array_splice() function.
This will produce following result
This can be done using count() function.
This will produce following result