Skip to content

Instantly share code, notes, and snippets.

@hisorange
Created April 14, 2014 19:09

Revisions

  1. Varga Zsolt created this gist Apr 14, 2014.
    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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("[email protected]", "ping", "i'm here");