Fixing PHP Compatibility Issues
-
Hi All,
I manage a web page with wordpress but am not at all familiar with html. My WordPress dashboard is telling me I need to update my PHP. I followed the steps to do it including using the plugin “PHP Compatibility Tracker” and it came up with some issues with my theme. I tried googling around and there were some answers to my problem but I couldn’t understand them. I’m hoping if paste the issues and the corresponding code below and someone might be able to just tell me how to change them?
1. Problem per the PHP Compatibility Plugin:
FILE: /home3/lvpc/public_html/wp-content/themes/andrinatheme/functions/admin-interface.php
———-
FOUND 2 ERRORS AFFECTING 1 LINE
———-
900 | ERROR | Extension ‘ereg’ is deprecated since PHP 5.3 and removed since PHP 7.0; Use pcre instead
900 | ERROR | Function ereg_replace() is deprecated since PHP 5.3 and removed since PHP 7.0; Use preg_replace() insteadFull Line of Corresponding Code in admin-interface.php(this is the only place “ereg” shows up):
$jquery_click_hook = ereg_replace(“[^A-Za-z0-9]”, “”, strtolower($value[‘name’]));
2. Problem per the PHP Compatibility Plugin:
FILE: /home3/lvpc/public_html/wp-content/themes/andrinatheme/template-contact.php
———–
FOUND 2 ERRORS AFFECTING 1 LINE
———–
20 | ERROR | Extension ‘ereg’ is deprecated since PHP 5.3 and removed since PHP 7.0; Use pcre instead
20 | ERROR | Function eregi() is deprecated since PHP 5.3 and removed since PHP 7.0; Use preg_match() insteadFull Line of Corresponding Code in template-contact.php(this is the only place “ereg” shows up):
} else if (!eregi(“^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$”, trim($_POST[’email’]))) {
Thank you so much for all your help in advance!
The topic ‘Fixing PHP Compatibility Issues’ is closed to new replies.