TYPES OF ARRAY IN PHP

PHP - Wikipedia

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

  1. Indexed array : array with a numeric keys.
  2. Associative arrays : Arrays with named keys
  3. Multidimensional arrays : Arrays containing one or more arrays
  1. 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
php tutorial - PHP Indexed Arrays - php programming - learn php - php code  - php script - wikitechy

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

PHP Array: Associative, Multidimensional
Facebook Notice for EU! You need to login to view and post FB Comments!