note 33033 added to control-structures.do.while

From: Date: Sat, 14 Jun 2003 17:34:31 +0000
Subject: note 33033 added to control-structures.do.while
Groups: php.notes 
Request: Send a blank email to php-notes+get-50344@lists.php.net to get a copy of this message
You can do an infinite-loop by using this: do { SendDynamicWebPageAndQueryUserFormAction(); ProcessUserAction(); } while (true); You may ask why in the world do anyone want to do an infinity-loop? I'm not trying to waste CPU or trying to tie up the system here. You often need to do this as the main program when someone accesses your dynamic web-page as "index.php" When you generate dynamic web-page, and process user's action depending on his/her response, how in the world do you want to exit the program. If you do, what would the user's web-page display? A black-hole?! I suppose you can close their web-window if you are kind enough, or maybe shut-down their computer if you are dubious enough :) ---- Manual Page -- http://www.php.net/manual/en/control-structures.do.while.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33033 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33033&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33033&report=yes

« previous php.notes (#50344) next »