Re: exit function
| From: | Joe Stump | Date: | Thu, 19 Oct 2000 22:34:53 +0000 |
| Subject: | Re: exit function | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21291@lists.php.net to get a copy of this message | ||
>
> See register_shutdown_function()
>
This doesn't execute when I CTRL-C the script under linux - am I missing
something?
<?
register_shutdown_function(shut_me_off);
function shut_me_off(){
$fp = fopen('/tmp/im_done','a+');
$string = 'Went down at '.date("Y-m-d h:i:s")."\n";
fwrite($fp,$string,sizeof($string));
fclose($fp);
}
while(1){
echo "Fooooooooooo!!!!!!!!!!!!!!!\n";
}
?>
--Joe
/*****************************\
* Joe Stump *
* www.Care2.com *
* Office: 650.328.0198 *
* Extension: 122 *
\*****************************/
http://www.miester.org/Joe/Stump/Joe_Stump_resume.html
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GB/E/IT d- s++:++ a? C++++ UL++$ P+ L+++$ E----! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D(++++) G++@ e+@ h@ r+! z(+++++**)!
------END GEEK CODE BLOCK------