Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 402 Bytes

execute_a_function_after_the_script_ends.md

File metadata and controls

15 lines (12 loc) · 402 Bytes

Execute a function after the script ends

Registers a callback to be executed after script execution finishes or exit() is called

function shutdown($param)
{
    // This is our shutdown function, in
    // here we can do any last operations
    // before the script is complete.

    echo 'Script executed with success', PHP_EOL;
}

register_shutdown_function('shutdown', 'some param');