Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
foreach example
<?php
$array = array(
'fruit1' => 'apple',
'fruit2' => 'orange',
'fruit3' => 'grape',
'fruit4' => 'mango',
'fruit5' => 'peach');
echo $array['fruit3'];
echo "\n";
foreach ($array as $v) {
echo "\$array: $v\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.