Home >Backend Development >PHP Problem >How to remove ubb code in php
How to remove ubb code in php: first open the corresponding code file; then use "\[.*?\"] to replace ubb; finally use "\d" to replace the number.
The operating environment of this article: Windows7 system, PHP7.1 version, DELL G3 computer
Specific questions:
php regular filter UBB code
[align=center][attach]93[/attach] [/align] [p=30, 2, left]中文[/p]
How to replace all ubb codes with regular rules, and remove the Chinese characters from the numbers in the ubb code.
Implementation method:
First replace ubb with \[.*?\]
and then Replace the numbers with \d
.
[Recommended learning: PHP video tutorial]
The above is the detailed content of How to remove ubb code in php. For more information, please follow other related articles on the PHP Chinese website!