$options = Typecho_Widget::widget('Widget_Options');
$sUrl = str_ireplace('/', '\/', rtrim($options->siteUrl, '/'));
$preg = '#(<a .*?href=")(?!' . $sUrl . ')([^"]+)"(.*?<\/a>)#ise';
$text = preg_replace($preg, "stripslashes('$1') . '$options->siteUrl' . 'go.html?url=' . base64_encode('$2') . '\" target=\"_blank\ "' . stripslashes('$3')", $text);
After the code was put into PHP7.0, an error was reported. According to the prompts, I learned that preg_replace was abandoned and had to be replaced by preg_replace_callback. How to do it?
It’s not that preg_replace is abandoned, it’s the /e modifier that is abandoned.
I think it should probably be changed like this
Where can I see that this function has been abandoned?
http://php.net/manual/zh/func...
Support (PHP 4, PHP 5, PHP 7)
Post an error message
Preg-prefixed functions are not obsolete, but eregi-prefixed functions are obsolete