For example, if I have a URL http://example.com/?src=example&test_28934
How do I remove everything after ?, so the user always lands on http://example.com?
I have tried this and the URL stays the same.
$current_url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$current_url = reset((explode('?', $current_url)));