请问正则过滤UBB代码

WBOY
Release: 2016-06-13 12:59:25
Original
871 people have browsed it

请教正则过滤UBB代码~

[link url="http://jjckb.xinhuanet.com/2012-11/29/content_415369.htm"]大连富豪富彦斌失踪9个月[/link]
Copy after login

改成 大连富豪富彦斌失踪9个月
------解决方案--------------------
$s='[link url="http://jjckb.xinhuanet.com/2012-11/29/content_415369.htm"]大连富豪富彦斌失踪9个月[/link]';
echo preg_replace('/\[link url="([^\"]+)"\]([^\[]+)\[\/link\]/','$2',$s);
Copy after login

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