Page 1 of 1

How to interrupt native function in php

Posted: Sat Dec 06, 2008 3:06 am
by dark_religion
I have a problem in my code. I parse web pages finding usfull information. But very usually there are bad servers on the net. They work slowly, and loading page of several kb takes up to minute or can take more.

So i am using file($where) where $where is page address.

So is there any way to interrupt this function if time exeeds some limit? or any other method to load page with ability to control the time!

Re: How to interrupt native function in php

Posted: Sat Dec 06, 2008 4:21 am
by requinix
If you want more control over how you retrieve information over the web, use something like cURL instead.

Re: How to interrupt native function in php

Posted: Sat Dec 06, 2008 6:52 am
by dark_religion
and it can stop loading page if it is loading slowly?