note 87993 deleted from features.connection-handling by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:44:25 +0000 |
| Subject: | note 87993 deleted from features.connection-handling by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196621@lists.php.net to get a copy of this message | ||
Note Submitter: fanfear at yahoo dot com
----
i use this code when i want php infinite loop
<?php
set_time_limit (0);//run script forever
ignore_user_abort ();//run script in background
$i = 0;
echo "start\n";
while (1) {
$i++;
echo $i, "\n";
$sleep = sleep (3);
if ($sleep == 0 or $sleep or $sleep == FALSE) continue;
if (connection_aborted ()) continue;
if (connection_status () != 0) continue;
}
?>