34,333
edits
Changes
→Create a PHP Array
Arrays are created using the ''array()'' function. The ''array()'' function takes zero or more arguments and returns the new array which must be assigned to a variable using the assigment operator (=). If arguments are provided they are used to initialize the array with data.
PHP arrays grow amd and shrink dynamically as items are added and removed so it is not necessary to specify the array size at creation time as it is with some other programming languages.
We can create an empty array as follows: