Hello, I'm trying to replace a deprecated preg_replace function with a preg_replace_callback and I'm running into a bit of a roadblock with the placement of some of the regex
$str = preg_replace("/\\b($all_uppercase)\\b/e", 'mb_strtoupper("$1", CHARSET)', $str);
Updated (but wrong):
$str = preg_replace_callback("/\\b($all_uppercase)\\b", create_function ( '$matches', 'return mb_strtoupper(matches[$1], CHARSET);'), $str);
I think I understand everything but I'm not sure how to represent the $1 in the new anonymous function with the matches variable. Can someone tell me what the proper syntax for this translation is?