Home > Backend Development > PHP Problem > How to remove ubb code in php

How to remove ubb code in php

藏色散人
Release: 2023-03-09 08:58:01
Original
1628 people have browsed it

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.

How to remove ubb code in php

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]
Copy after login

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!

Related labels:
php
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