PHP Infinite Loops

2 posts Page 1 of 1
Contributors
User avatar
_Crazy
Just Registered
Just Registered
Posts: 5
Joined: Thu Nov 25, 2010 11:47 pm

PHP Infinite Loops
_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;
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: PHP Infinite Loops
mandai
you can also use break; to stop the loop.
2 posts Page 1 of 1
Return to “Help & Support”