RE: Download a file from an external server using PHP
code: function geturl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);
$out = curl_exec($ch);
curl_close($ch);
return $out;
}
The previous sentence is false. The following sentence is true.
|