Peng
public php v1 · immutable<?php// Instead of:$data = file('http://www.whatever.com/file.txt');// You just have to use:$curl = curl_init('http://www.whatever.com/file.txt');curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);$data = explode("\n", curl_exec($curl));curl_close($curl);// You can even detect which is available and use that:if (extension_loaded('curl')) { // curl code...} elseif (ini_get('allow_url_fopen') != '') { // file() code...} else { exit("Uh-oh! We can't download the file!");}?>