10-24-2007, 10:32 PM
|
#10 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
I've modified it only slightly, but this works perfectly for me:
PHP Code:
function file_get_content( $url ) { for($i = 1; $i <= 3; $i++) { $ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $file = curl_exec($ch);//Returns file contents string, FALSE on failure curl_close($ch);
if($file) { return array( 1 => TRUE, 2 => $file ); break; } } return array( 1 => FALSE, 2 => '' ); }
var_dump(file_get_content('http://www.wiredflame.com/'));
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|