有关php正则,提取网页指定内容的问题。
有关php正则,提取网页指定内容的问题。
源码:
<meta name="httpfileurl" content=" http://stor.vdisk.cn/loadfile/c8/ce8%b5%84%e6%ba%90%
e7%9b%92%e4%bd%bf%e7%94%a8%e6on%95%99%e7%a8%8b.mp4">
请问怎么把content=后面的链接地址提取出来?
------解决方案--------------------
引用:
quote: 引用:
$content = '<meta name="httpfileurl"
content=" http://stor.vdisk.cn/loadfile/c8/ce8%b5%84%e6%ba%90%e7%9b%92%e4%bd%bf%e7%94%a8%e6on%95%99%e7%a8%8b.mp4">';
$content = preg_match("
------解决方案--------------------
content=\"(.*)\"
------解决方案--------------------
",$content,$match);
echo($match[1]);
代码是这样子的
<meta content="天之痕主题曲.mp3" name="description">
<meta name="httpfileurl"
content="
key=28bac3a4334746589415441857456dbe&tt=1391937000&st=yvmccoivfipswaonsennfa&filename=%e5%a4%a9%e4%b9%8b%e7%97%95%e
$content = preg_match("
------解决方案--------------------
\"httpfileurl\"(\s+)?content=\"(.*)\"
------解决方案--------------------
",$content,$match);
echo $match[2];
以上就是有关php正则,提取网页指定内容的有关问题的内容。