Home > Backend Development > PHP Tutorial > PHP message matching

PHP message matching

WBOY
Release: 2016-08-04 09:19:43
Original
1067 people have browsed it

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

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

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

Then compare it with your message template.

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