This is the case. At test.php, I have a function dotask(a,b,c,d);

This function need to do task that need 2-4 minutes to complete.
Task including insert new record into db, curl call to other url to do task and etc.

However, I want test.php to:
Just make sure dotask(a,b,c,d) is called, no need to wait until task completed then only return and continue with the remaining code at bottom.

Reason: test.php is a thank you page. I can't expect the user to wait few minutes for the task to be completed. Because I need to show thank you messages etc at that page to user.

What can I do?