Jump to content

continuous loop


ratcateme

Recommended Posts

I want to create an IRC bot the idea is that the script never ends until i send a kill message in IRC but i want to know about the best way to create the continuous loop that will check if any new messages have been sent on the server and respond to any commands sent to the bot this is what i have at the moment

<?php
while(1==1){
    //read stream
    //do stuff
}
?>

my question is weather 1==1 is the best way to create a loop or if i should use something else.

 

Scott.

Link to comment
https://forums.phpfreaks.com/topic/95182-continuous-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.