使用 php 读取 HTML 给出错误信息
我正在尝试从 http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page 使用以下内容 代码。
$some_link = http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page;
$content = file_get_contents($some_link);
echo $content;
但我得到了错误的页面而不是原始页面,
你能告诉我问题是什么吗?
谢谢。
I am trying to get some data from http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page using the below code.
$some_link = http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page;
$content = file_get_contents($some_link);
echo $content;
But i am getting wrong page instead of the original
Can you please tell me what the problem is?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
初始化
$some_link
时错过了引号。这会起作用。它将打开网页,因为
$some_link
包含 HTML 代码。这将打开与http://itunes .apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page
我已经尝试过了,效果很好
You missed quotes when initializing
$some_link
. This will work.it will open webpage because
$some_link
contains HTML code.This opens the same page ashttp://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page
I have already tried and it works fine