这个问题很简单.我将在PHP脚本中使用什么函数将URL中的数据加载到字符串中?
我想你在找
$url_data = file_get_contents("http://example.com/examplefile.txt");
CURL通常是一个很好的解决方案:http://www.php.net/curl
// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // grab URL and pass it to the browser $html = curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch);