PHP message matching
Aug 04, 2016 am 09:19 AM
There is an information template, such as:
"Name: @, phone number @, please notify this person"
The @ is a variable that needs to be modified, fill in the information, and become
<code>"姓名:小明,电话:15888888888,请通知此人" </code>
How can I tell whether the modified template uses the previous template?
Reply content:
There is an information template, such as:
"Name: @, phone number @, please notify this person"
The @ is a variable that needs to be modified, fill in the information, and become
<code>"姓名:小明,电话:15888888888,请通知此人" </code>
How can I tell whether the modified template uses the previous template?
Regular replacement preg_replace :xxx,
Replace with:@,
<code>$a = "姓名:小明,电话:15888888888,请通知此人"; var_dump(preg_replace('/:([^<]*?),/is',':@,',$a));</code>
Then compare it with your message template.

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

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
