Call to undefined function preg_filter()
程序员文章站
2023-12-30 12:20:58
...
用了preg_filter()函数,老提示Call to undefined function preg_filter() ,怎么回事啊?
回复内容:
用了preg_filter()函数,老提示Call to undefined function preg_filter() ,怎么回事啊?
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 ; } }
看下是不是PHP版本问题,这个函数应该是 5.3+之后的
preg_filter
(PHP 5 >= 5.3.0)
preg_filter — Perform a regular expression search and replace
可以用了,但前提必须是php5.3或以上的,都怪自己在编辑器里面没配置好才会出现这个错误的,I'm sorry~
推荐阅读
-
Call to undefined function preg_filter()
-
Call to undefined function bcompiler_write_header() 异常如何解决
-
PHP FATAL ERROR: CALL TO UNDEFINED FUNCTION BCMUL()解决办法_PHP
-
PHP对象编程有关问题,Call to a member function hello() on a non-object
-
Call to undefined function preg_filter()
-
PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 如何解决,mcryptmoduleopen
-
PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 如何解决,mcryptmoduleopen
-
【LAMP】Fatal error: Call to undefined function mb_detect_encoding(),该怎么解决
-
php 提示Call to undefined function curl
-
IIS下PHP连接数据库提示mysql undefined function mysql_connect