TYPES OF ARRAY IN PHP
ARRAY :- Array is a variable, which can hold more than one value OR diffrent types of data types at a time in a single variable.
ex- $data= array( “bikash”, 100,500,”rahul”);
There are three types of array in PHP
- Indexed array : array with a numeric keys.
- Associative arrays : Arrays with named keys
- Multidimensional arrays : Arrays containing one or more arrays
- NUMERIC array:- Numeric Array is a type of array with numeric indices to access its values. However, they can store numbers, characters, strings, etc. By default, the array indices are represented by numbers if not specified, and it starts with index 0 and ends with index -1
2. Associative arrays :-
Associative array differ from numeric array in the sense that associative arrays use diffrents names for id keys. And the key and value is saparated by “=>”.
Below ithe syntax for creating associative array in php