After PHP upgrade to php5.3, in the process of use often found that some programs will appear function eregi () is deprecated error message.
What is the reason?
This is because the eregi () function is no longer supported in php5.3 and is replaced with the Preg_match () function.
The workaround is to replace the eregi () function with the Preg_match () function.
if (eregi (' ^test ', $file))
can be replaced by
if (Preg_match ('/^test/i ', $file))
————-
PHP 5.3.0 after the regex, want to use the PCRE, POSIX regex is not recommended to use (the system of a regex, avoid too many?).
So the following is the non-recommended function (POSIX), with a list of proposed function (PCRE), see: PHP:
Differences from POSIX Regex
* Posix→pcre
* Ereg_replace () →preg_replace ()
* Ereg () →preg_match ()
* Eregi_replace () →preg_replace ()
* EREGI () →preg_match ()
* Split () →preg_split ()
* Spliti () →preg_split ()
* Sql_regcase () →no equivalent
* Split with Regex, can be replaced by Preg_split ()
* Do not need a regex, as long as you want to quickly split the fixed string, can be replaced by explode (). (Speed is much faster than the need for a regex)
http://www.bkjia.com/PHPjc/327783.html www.bkjia.com true http://www.bkjia.com/PHPjc/327783.html techarticle After PHP upgrade to php5.3, in the process of use often found that some programs will appear function eregi () is deprecated error message. What is the reason? This is because the php5.3 no longer ...