preg_replace_callback_array() - php 正则表达式(PCRE)
preg_replace_callback_array()
版本:php7
(PHP 7)
Perform a regular expression search and replace using callbacks
说明
preg_replace_callback_array(array $patterns_and_callbacks, mixed $subject[,int $limit= -1[,int &$count]]): mixedThe behavior of this function is similar to preg_replace_callback(), except that callbacks are executed on a per-pattern basis.
参数
$patterns_and_callbacksAn associative array mapping patterns(keys)to callbacks(values).
$subjectThe string or an array with strings to search and replace.
$limitThe maximum possible replacements for each pattern in each$subjectstring. Defaults to-1(no limit).
$countIf specified, this variable will be filled with the number of replacements done.
返回值
preg_replace_callback_array() returns an array if the$subjectparameter is an array, or a string otherwise. On errors the return value is NULL
If matches are found, the new subject will be returned, otherwise$subjectwill be returned unchanged.
范例
preg_replace_callback_array() example
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!