Skip to content

Instantly share code, notes, and snippets.

@heinthanth
Created September 1, 2019 03:51
Show Gist options
  • Save heinthanth/5142b2fd9326e8d893eb0c78682a591f to your computer and use it in GitHub Desktop.
Save heinthanth/5142b2fd9326e8d893eb0c78682a591f to your computer and use it in GitHub Desktop.
For Each
<?php
$x = [4, 5, 6, 7, 8];
foreach($x as $i) {
echo $i;
// will print 4, 5, 6, 7, 8 in each time since $i = $x[$i] in each time
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment