New course! Every coder should learn Generative AI!
Try a free lesson0
In associative array, the keys bear some relation to the value other than representing it's position in the array.
They are suitable when use of numerical indexed arrays.
eg.
<?php
$a=array('name'=>'vinay','email'=>'vinayxyz@gmail.com');
echo $a['name']."<br>";
echo $a['email']."<br>";
?>
o/p :-
vinay
vinayxyz@gmail.com