1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <?php $fruits = array ( "fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"), "numbers" => array(1, 2, 3, 4, 5, 6), "holes" => array("first", 5 => "second", "third") ); $fruits[0]["d"]="orange"; $fruits["fruits"]["d"]="Mango"; $fruits["fruits"]["c"]="Mango";
foreach ($fruits as $k=>$i) { foreach ($i as $a=>$b) { echo "$a.$b<br />\n"; }
} ?>
|