Created
September 4, 2014 16:10
-
-
Save bi0xid/01bb958d5ce401c8da15 to your computer and use it in GitHub Desktop.
Loop of 100 elements breaking every 10 elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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