how to solve the ereg function deprecated error [duplicate]

梦想的初衷 提交于 2019-12-25 03:15:01

问题


I am working with SEO PHP scripts and I am just following Google SEO scripts. When I used the search terms I got an error like the following:

Deprecated: Function eregi() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3876

Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3896

Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 1451

How should I remove that error function? Is there any need to use a library?


回答1:


eregi() function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

you can use preg_match().




回答2:


http://php.net/manual/en/function.eregi.php

Note:

As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED notice. See the list of differences for help on converting to PCRE.

You need to convert every use of ereg* to an equivalent function of the preg_* family. Or, as @Srisa rightly points out, look for an updated version of the library/script in question.




回答3:


error_reporting( 0 ) ;
That's how you can eliminate the symptoms, but to cure the disease you just shouldn't use POSIX regular expressions, change them to PCRE




回答4:


you may want to check this brunch http://sourceforge.net/projects/nusoapforphp53/ it works for me




回答5:


Change ereg() to mb_ereg.hope which fixes your error. Good luck!



来源:https://stackoverflow.com/questions/4825205/how-to-solve-the-ereg-function-deprecated-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!