$result = preg_replace(
"/\{([<>])([a-zA-Z0-9_]*)(\?{0,1})([a-zA-Z0-9_]*)\}(.*)\{\\1\/\\2\}/iseU",
"CallFunction('\\1','\\2','\\3','\\4','\\5')",
$result
);
The above code gives a deprecation warning after upgrading to PHP 5.5:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
How can I replace the code with preg_replace_callback()
?
[a-zA-Z0-9_]
should be shortened to\w
,{0,1}
to?
, and thei
pattern modifier serves to useful purpose. – Pragmatist