After PHP is upgraded to php5.3, some programs often find the function eregi () is deprecated error message.Why?
This is because the eregi () function is no longer supported in php5.3 and is replaced by the preg_match () function.
The solution is to replace the eregi () function with the preg_match () function.
If (eregi ('^ test', $ file ))
Can be replaced
If (preg_match ('/^ test/I', $ file ))
-----
The RegEx after PHP 5.3.0 is expected to use the PCRE specification. POSIX RegEx is not recommended (Unified RegEx to avoid too many specifications ?).
Therefore, the following is a list of functions (PCRE) not recommended for use (POSIX) and recommended for replacement: 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 of RegEx is required, which can be replaced by preg_split ().
* No RegEx is required. You only need to quickly split a fixed string and replace it with explode (). (The speed is much faster than that of RegEx)
Function eregi () is deprecated