[eluser]jonez[/eluser]
[quote author="Bigil Michael" date="1396350530"]sorry it will not work for me.
my requirements is to stop the execution of loop at 5 and start the execution from 6. in between 5 and 6 i want to print some static contents.[/quote]
Why? Stopping and restarting or checking and printing between iterations will accomplish the same thing.
If it's a numeric array you could do this instead, but it will produce the same output and is a lot more code:
Code:
for ( $i = 0, $len = 5; $i < $len; $i++ ) {
echo $arr[ $i ];
}
echo '--';
for ( $i = 5, $len = 10; $i < $len; $i++ ) {
echo $arr[ $i ];
}
echo '--';
for ( $i = 11, $len = 15; $i < $len; $i++ ) {
echo $arr[ $i ];
}