Obtenga la URL sin la cadena de consulta PHP

// get the url before the first occurence of "?"
$url = strtok($_SERVER["REQUEST_URI"], '?');
Lonely Doge