If you often use PHP open source program, after upgrading the PHP environment, must have encountered, Deprecated:function ereg_replace () error message
In the php5.3 version, in order to make programming more concise, discarded the ereg_replace regular function, but some early development of the PHP program, this function is often used, the following I have two ways to solve:
1. Replace the PHP version to php5.0, continue to use the previous version of the PHP environment, but this method is a bit less objective, if you are the purchase of virtual host, you can not replace PHP version 2. Modify the configuration file of the PHP environment, that is, modify the php.ini file:to find; Extension=php_mbstring.dll changed to: Extension=php_mbstring.dllfound; mbstring.func_overload = 0 modified to: mbstring.func_overload = 7This will continue to work, but modifying the php.ini file is as restrictive as the first method, and not all PHP runtime environments you have the right to modify 3. Using the latest regular function preg_replace, slightly different in regular substitution, such as: Ereg_replace ("[/\]{1 ,} ", '/', dirname (__file__)) modified should be: Preg_replace ("/[/\]{1,}/", '/', dirname (__file__)) in phpv5.3, PHP recommends the 3rd method, Because Preg_replace is much more efficient than ereg_replace.
About PHP Error: Deprecated:function ereg_replace () workaround