Associative Array¶
An associative array is an array whose keys are strings; there may also be integer index, mixed with the string ones.
In the evolution of PHP, associative arrays evolved into objects, where the index in the array turned into property names.
It is possible to use types others than integer and string with an array syntax: this requires building an object for that.
<?php
$associative = ['a' => 1, 'b' => 4, 3 => 5, 6 ];
echo $associative['a'];
?>
Related : Indexed Array, Array, Collection, Dictionary, Index, ArrayAccess, Pair