Skip to content

Instantly share code, notes, and snippets.

@nncl
Last active August 29, 2015 14:13
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 nncl/9f447727f0942d84ee23 to your computer and use it in GitHub Desktop.
Save nncl/9f447727f0942d84ee23 to your computer and use it in GitHub Desktop.
Loop php
<?php for($i=0;$i<12;$i++) : ?>
/*code here*/
<?php endfor; ?>
For each:
$colors = array("red", "green", "blue", "yellow");
foreach ($colors as $cor) {
echo "$cor <br/>";
}
ou
<?php foreach ($array as $key => $valor) : ?>
//ifs, elses, code here...
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment