PHP正则-多个span标签有关问题

WBOY
Release: 2016-06-13 13:52:40
Original
1415 people have browsed it

PHP正则-多个span标签问题

This is fake headline
如何提取标签,让上面的代码变成
[color="color: #ff0000;"][font-size="medium;"]This is fake headline[/font-size][/color]

这两标签相互颠倒的时候,问题就来了,因为他们的结束标签都是一样的,让人抓狂,有什么解决方法么。


------解决方案--------------------
使用preg的贪婪模式
------解决方案--------------------

$str = ' This is fake headline ';

preg_match_all('/

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!