fixed pregtr function with preg_replace_callback

http://stackoverflow.com/a/22662260 use this version, it works for me