When cacti and php5.3.6 are deployed, an error is reported. I know that php version is too high, but I don't want to downgrade it, but php is not very helpful. please help me to see how to change the code. This error is reported before modification. PHPDeprecated: Functionereg_replace () isdeprecatedinusrlocalapache2htdocslibsnmp. php deploys cacti and php5.3.6 to report an error.
I know that php version is too high, but I don't want to downgrade it, but php is not very helpful. please help me to see how to change the code.
This error is reported before modification.
PHP Deprecated: Function ereg_replace () is deprecated in/usr/local/apache2/htdocs/lib/snmp. php on line 341
PHP Deprecated: Function ereg_replace () is deprecated in/usr/local/apache2/htdocs/lib/snmp. php on line 426
Code:
$ String = trim (ereg_replace ("{. * = ?} "," ", $ String ));
$ String = ereg_replace (REGEXP_SNMP_TRIM, "", $ string );
After changing ereg_replace to preg_replace, the following error is reported for the last two sections of code:
PHP Warning: preg_replace (): No ending delimiter '.'
PHP Warning: preg_replace (): Unknown modifier
What is going on? how can this problem be solved?
------ Solution --------------------
PHP Deprecated: this is a warning specific to php5.3. it indicates that the function is already in the elimination plan. we recommend that you do not use it.
The simplest solution is to block this error category.
If you use other functions, you have to comply with people's conventions. who can blame you for making a mistake?
------ Solution --------------------
Instead of replacing it with preg_replace. The first parameter of this function is regular. Your format is incorrect. The regular expression should use // or # as the break-down character.
------ Solution --------------------
You need to clarify your needs first. What else do I need to replace? {. * = ?} And REGEXP_SNMP_TRIM?