Or: Code:
$data = file_get_contents($url, false);
And if you have to deal with Timeouts, Curl is an option:
Code:
$handle = curl_init();
curl_setopt ($handle, CURLOPT_URL, $url);
curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($handle, CURLOPT_RETURNTRANSFER, 1);
$data= curl_exec($handle);
curl_close($handle);