这比以往更为复杂,但只有这些联系才能得到,这些联系实际上是<代码>videos[0] = http://myvideos.com/video1mov;。
$tmp=str_replace(array("
","
"), ,$original,$matches);
$pattern= /<script>s+var videos.*?((s*videos[d+] = .http://.*?;s*?)+)(.*?)</script>/ ;
$a=preg_match_all($pattern,$tmp,$matches);
unset($tmp);
if (!$a) die("no matches");
$pattern="/videos[d+] = /";
$matches=preg_split($pattern,$matches[1][0]);
$final=array();
while(sizeof($matches)>0) {
$match=trim(array_shift($matches));
if ($match== ) continue;
$final[]=substr($match,1,-2);
}
unset($matches);
print_r($final);
在该次会议上,在履行机构提出反馈意见后,简化版本如下:
$original=file_get_contents($url);
$pattern= /http://.*?.mov/ ;
$a=preg_match_all($pattern,$original,$matches);
if (!$a) die("no matches");
print_r($matches[0]);