+
95
-

php7报错Call to undefined function ereg_replace()

php

php7报错Call to undefined function ereg_replace()

代码为

 ereg_replace("^.+@([^@]+)$", "\\1", $address);

在php5下运行正常,但是到了7就报错,请问怎么解决?

网友回复

+
15
-

ereg_replace在php7以后已经废弃了,可使用preg_replace...

点击查看剩余70%

我知道答案,我要回答