Hello,
my question is, how to specify something like file_get_contents to get an content of a webpage with an timeout.
Aim would be, to request that file, and if this request time out (for example it couldnt get the file for more than 5 seconds) then the request quits.
My script uses then a cached record of this site.
But how to do this with php 4.3.x? with 5.x you could specify timeout with context, but before not.
I found something like
ini_set('default_socket_timeout', 5);
$content = file_get_contents("http://" . $myurl);
but this ini_set doesnt work, but that was the only solution I could found with Google. What else would be one practical good solution to get contents of an url, perhaps instead of using file_get_contents but where I can specify timeout?
thanks for your help.