Skip to content

Instantly share code, notes, and snippets.

@gnilchee
Created September 16, 2018 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnilchee/3ff4b476ee2700b00fe13d075310f74d to your computer and use it in GitHub Desktop.
Save gnilchee/3ff4b476ee2700b00fe13d075310f74d to your computer and use it in GitHub Desktop.
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