PHP Arrays are a collection of variables, which stores multiple values of same or different datatype at a time.
Array is a collection of types.The array can hold any type.It can contain strings,integers,floating points and even other arrays.Each of these values inside an array can be accessed with a related key value pair.An array can be created in two ways.array() or array.Array() function can be used to create an array in PHP.
Indexed arrays - These arrays has a numeric index
Associative arrays - These arrays has named keys
Multidimensional arrays - These arrays has one or more arrays.
Every array element in the indexed array stores a numeric index. It can be created in two ways.
1) The assignment of index is done automatically.
// Define an indexed array
$names = array("John", "Mike", "Brake");
2) The assignement of index is done manually.
$colors = "John";
$colors = "Mike";
$colors = "Brake";