Page 1 of 1

PHP Infinite Loops

Posted: Fri Nov 26, 2010 12:02 am
by _Crazy
Hello everybody! I am new here, but I am not a noob..
Anyways I will show you an example on how to do loops in PHP ;)

Simply in the code where you need to loop something add:
Code: Select all
for (;;) {
//Code To Loop Here
} 
It's that simple! It's kind of like the 'while' statement.

Here is an example of looping echos:
Code: Select all
for (;;) {
echo "\nLooping...\n";
} 
If you need any help please reply in this topic and I will try and help! cooll;

Re: PHP Infinite Loops

Posted: Fri Nov 26, 2010 1:49 am
by mandai
you can also use break; to stop the loop.