常阳时光

Fatal error: Uncaught Error: Call to undefined function ereg_replace() PHP 7

PHP7 已经弃用 ereg_replace(),所以这样的代码会报错:$jquery_click_hook = ereg_replace("[^A-Za-z0-9]", "", strtolower($value['name']));

解决办法:用 preg_replace() 替换,如:$jquery_click_hook = preg_replace("[^A-Za-z0-9]", "", strtolower($value['name']));

原文:Stack Overflow - php 7 - Fatal error: Uncaught Error: Call to undefined function ereg_replace() PHP 7


ereg_replace("<div[^>]*><ul[^>]*>"

可以改成

preg_replace("/<div[^>]*><ul[^>]*>/"

via:PHP 7.x preg_replace替换了ereg_replace,D8主题崩坏