Topic: Detaching a function
Is there any way in PHP to detach a running function so that it will continue in the background, so that the calling script may carry on with its tasks?
Cheers,
Matt
You are not logged in. Please login or register.
PunBB Forums → Programming → Detaching a function
Is there any way in PHP to detach a running function so that it will continue in the background, so that the calling script may carry on with its tasks?
Cheers,
Matt
Not natively, PHP doesn't support multi-threading.
Cheers.
Edit: Just out of curiosity, does the 'not natively' bit mean there is an alternative way to do it?
If your installation supports system() calls, yes.
system('php script.php &');
You can also call a script through the webserver via fsockopen.
However, again, those are not real multi-threading
PunBB Forums → Programming → Detaching a function
Powered by PunBB, supported by Informer Technologies, Inc.