Skip to content

Instantly share code, notes, and snippets.

@bi0xid
Created September 4, 2014 16:10
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 bi0xid/01bb958d5ce401c8da15 to your computer and use it in GitHub Desktop.
Save bi0xid/01bb958d5ce401c8da15 to your computer and use it in GitHub Desktop.
Loop of 100 elements breaking every 10 elements
<?php
$contador = $_GET['c'];
// we can use any top number we need
if ( $contador >= 100 ) {
echo 'script terminado';
} else {
if ( $contador == '' )
$contador = 0;
$final = $contador + 10;
for ( $i = $contador; $i < $final; $i++ ) {
echo "ejecutado $i <br />";
}
echo "<br />Siguiente bloque...</br>";
$location = 'http://$url/basic-loop.php?c='.$i;
echo "<meta http-equiv='refresh' content='3;$location'>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment