The modifier that PHP does not support is the /e modifier.
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);
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);
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!