In this section, you will learn about associative arrays and it 's implementation.
In an associative array, a key is associated with a value. We can use values as key and assign value to them.
Given below example will give you a clear idea :
In the below example, we used an array named as "array" to assign ages to different persons. The key here is the name of the persons and we assign value to these keys.
<?php
$array=array("Ramesh"=>30,"Dinesh"=>32,"Mahesh"=>29,"Suresh"=>27);
$array["Vijay"]=34;
$array["Brijesh"]=26;
echo "Ramesh is ".$array["Ramesh"]." years old.</br>";
echo "Dinesh is ".$array["Dinesh"]." years old.</br>";
echo "Mahesh is ".$array["Mahesh"]." years old.</br>";
echo "Vijay is ".$array["Vijay"]." years old.</br>";
echo "Ramesh is ".$array["Ramesh"]." years old.</br>";
echo "Brijesh is ".$array["Brijesh"]." years old.</br>";
?>
The output of the above example is given below :

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.