Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in...
Mam taki kod:
$meta_characters = array("*" => ".+", "?" => ".", "\\" => "\\\\", "^" => "\\^", "\$" => "\\\$", "." => "\\.", "[" => "\\[", "]" => "\\]", "|" => "\\|", "(" => "\\(", ")" => "\\)", "{" => "\\{", "}" => "\\}", "+" => "\\+", "-" => "\\-"); $txt = preg_replace("/(\\*|\\?|\\\\|\\^|\\\$|\\.|\\[|\\]|\\||\\(|\\)|\\{|\\}|\\+|\\-)/ie", "\$meta_characters['\\1']", $txt);
próbowałem zrobić tak
$txt = preg_replace_callback("/(\\*|\\?|\\\\|\\^|\\\$|\\.|\\[|\\]|\\||\\(|\\)|\\{|\\}|\\+|\\-)/i", function($m){return "\$meta_characters['\\1']";}, $txt);
ale nie działa. Co robię źle?