Loop Through an Associative Array in PHP
Description
The following code shows how to loop Through an Associative Array.
Example
// ww w .j a va2 s.c om
<?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.