Keep web server working after returning output to client (in php)
<p>I am having a PHP web page which has a button. Whenever the user click this button, an AJAX request is sent to the server, and an email is sent back to him. A notification is also displayed on the screen. (It's similar to commenting on Facebook, the message is displayed, while the server keeps working to send emails).</p>

<p>Since sending email takes time, I want the server to return the output to the user first, then keeps working to send email. </p>

<p>Anyone knows how to achieve this in PHP? Thanks.</p>
