return row of key from foreach in php code example
Example 1: loop through values of hash php
foreach ($array as $key => $val) {
print "$key = $val\n";
}
Example 2: php foreach
<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
foreach($age as $x => $val) {
echo "$x = $val<br>";
}
?>
Example 3: return row of key from foreach in php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");