<?
function usecurl1($url)
{
$ch = curl_init();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_URL, $url );
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/1.6");
$output['html'] = curl_exec ( $ch );
$output['opt'] = curl_getinfo ($ch);
curl_close($ch);
return $output;
}
function usecurl($url)
{
$output=usecurl1($url);
return $output['html'];
}
$output=usecurl1("http://en.wikipedia.org/wiki/Special:Random"); //doesn't work
print_r ($output);
echo '<br>';
$output=usecurl1("http://yahoo.com"); //works
print_r ($output);
?>
Why?