Take a look at pcntl functions, namely pcntl_signal. But this extension is not enabled by default.

Decapode Azur wrote:
hi all,

Is there a way, for a cli script, to detect Ctrl_D or Ctrl_Z ?
My cli php script runs a loop while(1) and I would like to find a way to stop it from a user action.
(Waiting a better solution I've made: if(file_exists('./stop'))
and type the command >stop to stop the script.
I can not use readline cause this would break the loop.)


thanks


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to