fixed pregtr function with preg_replace_callback