Skip to content

Instantly share code, notes, and snippets.

@flaviors200
Created June 10, 2019 13:23
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 flaviors200/6ff7c73b8fd745513fa5c6202b71f435 to your computer and use it in GitHub Desktop.
Save flaviors200/6ff7c73b8fd745513fa5c6202b71f435 to your computer and use it in GitHub Desktop.
Loop statement: for optimized
<?php
$colors = ['blu', 'giallo', 'verde', 'rosso', 'bianco'];
for ($i = 0, $count = count($colors); $i < $count; $i++) {
echo "$colors[$i]\n";
}
/** Output **
/ blu
/ giallo
/ verde
/ rosso
/ bianco
/*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment