$source = preg_replace('/&#(\d+);/me', "utf8_encode(chr(\\1))", $source);
The above code gives deprecated warning.
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
How can I replace preg_replace() to preg_replace_callback() ?