Advertisement
Guest User

Untitled

a guest
Jan 28th, 2014
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. ignore_user_abort(false); // Do not ignore user abort
  4. set_time_limit(0); // Allow script to run forever
  5.  
  6. /* sleep 10 seconds */
  7. for($i = 0; $i < 10; ++$i)
  8. {
  9.     /* ignore_user_abort/connection_status won't work without these 3 instructions: */
  10.     echo chr(0); // write something to the output buffer (a null character)
  11.     ob_flush(); // send/clear the output buffer
  12.     flush();
  13.    
  14.     sleep(1);
  15. }
  16.  
  17. // This file won't be created when the connection is aborted.
  18. file_put_contents('helloWorld', '');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement