Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 628 Bytes

File metadata and controls

14 lines (9 loc) · 628 Bytes

Call a function on script exit with register_shutdown_function

To call a function on script exit, use the register_shutdown_function in PHP.

function shutdown_handler() {
    // Send an email, notification, etc.
}

register_shutdown_function("shutdown_handler");

See the official documentation, as well as some Stack Overflow posts.