正则有关问题,用,大家帮帮忙

WBOY
Release: 2016-06-13 13:44:52
Original
890 people have browsed it

正则问题,急用,大家帮帮忙啊





















  用户编码  

开启SMS功能  

IP地址    

登陆方式    

11111

  [#SUB_2#用户编码]  

[#SUB_2#开启SMS功能]    

  [#SUB_2#IP地址]  

[#SUB_2#登录方式]    

2222222

---------------在以上的HTML中匹配出--------------------------------



  [#SUB_2#用户编码]  


[#SUB_2#开启SMS功能]    


  [#SUB_2#IP地址]  


[#SUB_2#登录方式]    



------------------注意这里
在 中,id= "loop "的左右可能有其他的标签,也可能没有,
如:


反正就是不关怎么变都要能取出
以上那一段HTML

大家帮帮忙啊。谢谢了

------解决方案--------------------
$html =



















用户编码

开启SMS功能

IP地址

登陆方式

11111

[#SUB_2#用户编码]

[#SUB_2#开启SMS功能]

[#SUB_2#IP地址]

[#SUB_2#登录方式]

2222222

EOD;

$pattern = '/( .* )/Us ';
if (preg_match($pattern, $html, $match))
{
echo htmlspecialchars($match[1]);
}
else
echo 'no match ';
?>
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!