有人可以帮我获取页面的代码吗?我使用的代码是:获取嵌入到html网址字符串中的动态变量并获取它的html代码
<?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
感谢老板,但与你提出的改变,我做了一些事情,但我的主要目标是通过我得到的代码来提取每个视频的标题和描述,其中我提供的URL是包含播放列表pf所有视频的页面 – krishna