【发布时间】:2012-01-05 08:31:10
【问题描述】:
我尝试了许多方法来尝试获取 url 的内容,哈希值会影响输出。我真的不知道如何解释它,但这里有一个例子......
在做:
echo file_get_contents('test.com/whatever.php?t1=1&t2=2#this');
将返回与以下相同的结果:
echo file_get_contents('test.com/whatever.php?t1=1&t2=2');
即使我在网络浏览器中导航到它,它也会有所作为。当然,上面的 url 不是我实际使用的,但我希望你明白这一点。
我尝试过的事情:
卷曲:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
file_get_contents:
file_get_contents($url);
阅读:
//don't know where I put the code.
这些都是我尝试过的所有东西,除了这里,我真的不知道下一步该去哪里。我真的不确定这是否可能,但我希望是的。
感谢您的帮助,sh042067。
【问题讨论】:
标签: php hash file-get-contents