use `preg_replace` to remove the query string