Loop through and print all the values of an associative array in PHP
Description
The following code shows how to loop through and print all the values of an associative array.
Example
/* w ww. j a va 2 s . c o m*/
<?php
$age=array("XML"=>"35","HTML"=>"37","CSS"=>"43");
foreach($age as $x=>$x_value){
echo "Key=" . $x . ", Value=" . $x_value;
echo "<br>";
}
?>
The code above generates the following result.