Skip to content

Instantly share code, notes, and snippets.

@hisorange
Created April 14, 2014 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisorange/10675123 to your computer and use it in GitHub Desktop.
Save hisorange/10675123 to your computer and use it in GitHub Desktop.
work after disconnection
function endOutput($endMessage){
ignore_user_abort(true);
set_time_limit(0);
header("Connection: close");
header("Content-Length: ".strlen($endMessage));
echo $endMessage;
echo str_repeat("\r\n", 10); // just to be sure
flush();
}
// Must be called before any output
endOutput("thank you for visiting, have a nice day');
sleep(100);
mail("you@yourmail.com", "ping", "i'm here");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment