我一直在使用下面的代码获取网页的HTML内容PHP的file_get_contents不能得到HTML代码
$url = "http://mysmallwebpage.com/";
$html = file_get_contents($url);
然而,file_get_contents
无法打开以下形式的网址,但如果我键入他们在网络浏览器的地址栏中打开,这些URL可以打开。
www.etsy.com/listing/118415624/not-my-small-diary-17-true-high-school
blog.al.com/birmingham-news-commentary/2012/11/naked_art_gallery_gives_back_t.html
mysmallwebpage.com/
你能告诉我什么我可以用来打开上面的URL在PHP?
继不起作用
$url = "www.etsy.com/listing/118415624/not-my-small-diary-17-true-high-school";
$html = file_get_contents($url);
检查你的php.ini中的'allow_url_fopen' – 2013-04-20 08:42:56