有关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=后面的链接地址提取出来?
6本文来源gao@dai!ma.com搞$代^码!网7
搞gaodaima代码
——解决方案——————–
引用:
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正则,提取网页指定内容的有关问题的内容,更多相关内容请关注搞代码(www.gaodaima.com)!