正则匹配file_get_contents,该如何处理

WBOY
Release: 2016-06-13 10:23:43
Original
971 people have browsed it

正则匹配file_get_contents
用file_get_contents过来后的内容为

HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->........<span class="music-icon-hook { 'musicIcon': { id: '7313936' , type:'song', iconStr:' play add collect songword download' } }">........</span>
Copy after login


我想取得id 正则表达式怎么写比较好 望大家不吝赐教 



------解决方案--------------------
直接写就是拉。
preg_match("/id: '(\d+)'/",$str,$m);
echo $m[1];
------解决方案--------------------
截取截取
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template