PHP正则-多个span标签有关问题
Jun 13, 2016 am 10:03 AM
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('/

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What are the differences between Huawei GT3 Pro and GT4?

Fix: Snipping tool not working in Windows 11

How to dynamically modify style in react

What are the new features in Vue3 style and how to use them

How to Fix Can't Connect to App Store Error on iPhone

Vue error: Unable to use v-bind to bind class and style correctly, how to solve it?
