Modifiers not supported by PHP

藏色散人
Release: 2023-02-26 10:56:02
Original
3208 people have browsed it

Modifiers not supported by PHP

The modifier that PHP does not support is the /e modifier.

Modifiers not supported by PHP

For specific modifiers, please refer to the following address:

Available pattern modifiers in regular expression pattern:

http://php.net/manual/zh/reference.pcre.pattern.modifiers.php

Example:

$_smarty="ok";
$_smarty_results = preg_replace('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s','date("Y-m-d H:i:s")',$_smarty);
Copy after login

After changing to preg_replace_callback:

$_smarty_results = preg_replace_callback('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s',function($match){return date("Y-m-d H:i:s");},$_smarty_results);
Copy after login

For more PHP-related knowledge, please visit PHP中文网!

The above is the detailed content of Modifiers not supported by 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!