i have this code
$read = preg_replace(array('/LANG\[([0-9]*?)\]/e','/URL\[([0-9]*?)\]/e'),array('get_words(\\1)','url(\\1)'),$read);
how to fix it using preg_replace_callback
i have this code
$read = preg_replace(array('/LANG\[([0-9]*?)\]/e','/URL\[([0-9]*?)\]/e'),array('get_words(\\1)','url(\\1)'),$read);
how to fix it using preg_replace_callback
The error message is telling you to remove the e
modifier.
The e
modifier is now removed/deprecated - https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
You can simply change the /e
to /i
to read this;
$read = preg_replace(array('/LANG\[([0-9]*?)\]/i','/URL\[([0-9]*?)\]/i'),array('get_words(\\1)','url(\\1)'),$read);
or remove the e
completely to read this;
$read = preg_replace(array('/LANG\[([0-9]*?)\]/','/URL\[([0-9]*?)\]/'),array('get_words(\\1)','url(\\1)'),$read);