Fri, 17 May 2024


How to set up a function which will be called at the end of the execution of the PHP script?

By: Nathalie, NetArt Media
Sun, 13 September 2020

Be aware that this function will be called even id the connection with the client has been aborted or timed out and in fact that's why this approach could be very useful in some cases.

<?php

function YourFunction()
{
...
}

register_shutdown_function("YourFunction");
?>


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox