PHP "Fork" process (closes connection and keeps running)
// Close remote connection and continue
ob_end_clean();
ignore_user_abort(true);
header("Connection: close");
ob_start();
echo "The user will see this";
$size = ob_get_length();
header("Content-Length: $size");
ob_end_flush(); // Strange behaviour, will not work unless flush() is called immediately after!
flush();
// Fork complete!
echo "The user will NOT see this";
Comments