tur*_*bod 5 php error-handling
我有一个脚本有时会给Max执行时间达到错误.这是正常的,这不是问题.问题是,在这种情况下,我会写特定的错误消息.
我该怎么做呢?
function say_goodbye() {
if (connection_aborted()) {
// Perform some action if user has aborted the transaction
} elseif (connection_status() == CONNECTION_TIMEOUT) {
// perform some other action if the connection has timed out
} else {
// any normal completion actions
}
}
register_shutdown_function("say_goodbye")
Run Code Online (Sandbox Code Playgroud)
还可以向关闭函数传递参数