【发布时间】:2012-02-15 02:16:13
【问题描述】:
有人可以帮我获取页面的代码吗?我使用的代码是:
<?php
$v='bla bla';
$j=2;
$x='';
$h=str_replace($x,$v,"http://www.youtube.com/watch?v=$x&list=blabla&index=$j++&feature=plpp_video");
$html = file_get_contents($h);
echo $html;
?>
wamp 正在抛出类似的错误
Warning: file_get_contents(http://www.youtube.com/watch?v=&list=blabla&index=2&feature=plpp_video)
[function.file-get-contents]: failed to open stream:
HTTP request failed! HTTP/1.0 404 Not Found in C:\wamp\www\php trails\trails\new 8.php on line 6
如果 x 没有被声明为 null,它会说:
Notice: Undefined variable: x in C:\wamp\www\php trails\trails\new 8.php on line 5
【问题讨论】: