Andrew R Posted October 26, 2010 Share Posted October 26, 2010 Hi there. How do I stop a function from running it it's taking to long to proccess. For example, say after 10 seconds the code is still working I display an error message? As you can in the following code it's pulling the contents from an url or file which might take too long to load. function Tester($url); { return file_get_contents($url); } Thanks a mil Link to comment https://forums.phpfreaks.com/topic/216917-how-to-timeout-php-functions/ Share on other sites More sharing options...
Anti-Moronic Posted October 26, 2010 Share Posted October 26, 2010 This will likely interest you: http://php.net/manual/en/function.set-time-limit.php Hope that helps! Link to comment https://forums.phpfreaks.com/topic/216917-how-to-timeout-php-functions/#findComment-1126871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.