PHP Execution After Client Disconnection
Jan 29, 2009 · 1 minute readCategory: php
This is post is now quite old and the the information it contains may be out of date or innacurate.
If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub
If a client disconnects (closes the browser window / tab) and PHP subsequently tries to send information to the client but fails, the script stops executing.
Echoing does not necessarily mean sending information as PHP uses an output buffer. If you use the flush() function though you can force the buffer to be flushed to the client.
If you want to be sure a script will continue to execute when a client has disconnected, you can use the ignore_user_abort() function which will do exactly that.
Problem Solved :-)