Created
April 14, 2014 19:09
-
-
Save hisorange/10675123 to your computer and use it in GitHub Desktop.
work after disconnection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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