How to interrupt native function in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dark_religion
Forum Newbie
Posts: 3
Joined: Sat Dec 06, 2008 3:00 am

How to interrupt native function in php

Post 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!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to interrupt native function in php

Post by requinix »

If you want more control over how you retrieve information over the web, use something like cURL instead.
dark_religion
Forum Newbie
Posts: 3
Joined: Sat Dec 06, 2008 3:00 am

Re: How to interrupt native function in php

Post by dark_religion »

and it can stop loading page if it is loading slowly?
Post Reply