preg_replace with /e modifierwith preg_replace_callback.