Continue running a php script after page is returned
<p>I'm trying to write a script that will create a file on the server then use <code>header()</code> to redirect the user to that file. Then, after about 10 seconds I want to delete the file. I've tried this:</p>

<pre><code>header('Location: '.$url);
flush();
sleep(10);
unlink($url);
</code></pre>

<p>But the browser just waits for the script to complete then gets redirected, but the file hes been deleted by that time. Is there someway to tell the browser "end of file", then keep computing? Or maybe have PHP start another script, but not wait for that script to finish?</p>
