The php associative arrays are used to name the keys with its respective values.
Example
[php]<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
echo "Peter is " . $age[‘Peter’] . " years old.";
?>[/php]
In the block of code, we have assigned a variable $age to the array. The array has an associative name and its respective values. For instance, the key Peter has given the value 35 and so on. We are using the key to get the value from the array in the echo statement.
The above will generate the following result.
Peter is 35 years old.