Key iteration
$arr = ["foo" => "bar", "bar" => "foo"];
foreach ( $arr as $key => $value )
{
echo "key: " . $key . "\n";
echo "val: {$arr[$key]}\n";
}
Comments
$arr = ["foo" => "bar", "bar" => "foo"];
foreach ( $arr as $key => $value )
{
echo "key: " . $key . "\n";
echo "val: {$arr[$key]}\n";
}