您的位置:首页 > 编程语言 > PHP开发

php register_shutdown_function

2011-03-17 14:47 429 查看
官方描述:

void register_shutdown_function ( callback $function [, mixed $parameter [, mixed $...]] )
Registers the function named by function to be executed when script processing is complete or when exit() is called.

Multiple calls to register_shutdown_function() can be made, and each will be called in the same order as they were registered. If you call exit() within one registered shutdown function, processing will stop completely and no other registered shutdown functions will be called.

register_shutdown_function(do_exit());
function do_exit()
{
echo "goodbye,my boys.";
}
exit("oh,my lady gaga!");

这样执行exit前自动调用do_exit方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: