PREG_REPLACE_EVAL is deprecated, use preg_replace_callback

Please let me know if I got the coding style wrong.