When the preg_filter () function is used, the old prompt Calltoundefinedfunctionpreg_filter () is displayed. why? When the preg_filter () function is used, the Call to undefined function preg_filter () is always prompted. why?
Reply content:
When the preg_filter () function is used, the Call to undefined function preg_filter () is always prompted. why?
php
//php 5.3-if (!function_exists('preg_filter')) { function preg_filter($pattern, $replace, $subject, $limit = -1 , &$count = null) { if(!is_array($subject)) { $noArray = 1 ; $subject = array($subject); } $preg = preg_replace($pattern, $replace, $subject, $limit, &$count); $diff = array_diff($preg, $subject); if($noArray == 1) $diff = implode($diff) ; return $diff ; } }
Check whether the PHP version is correct. this function should be later than 5.3.
Preg_filter
(PHP 5> = 5.3.0)
Preg_filter-Perform a regular expression search and replace
You can use it, but the premise must be php5.3 or above. you may encounter this error because you have not configured it in the editor. I'm sorry ~