Calltoundefinedfunctionpreg_filter ()

Source: Internet
Author: User
Tags preg
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 ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.