我有这个脚本,它在服务器中工作得很好,但在本地 wamp 中它给出了错误
我有 fopen 开启
Warning: get_headers(): This function may only be used against URLs in C:\wamp\www\url\test5.php on line 8
<?php
$websitelink= 'http://www.brobible.com/girls/article/miley-cyrus-21st-birthday-party';
$html = file_get_contents($websitelink);
$doc = new DOMDocument();
@$doc->loadHTML($html);
$tags = $doc->getElementsByTagName('img');
foreach ($tags as $tag) {
$data = get_headers($tag->getAttribute('src'),1);
$op7=''.$tag->getAttribute('src').'';
echo $op7;
}
?>
此代码在服务器中运行良好,但在本地 wamp 服务器中运行良好