Change preg_replace to preg_replace_callback