What is the purpose of displaying only the pure URL without file names or variables on a page?

Displaying only the pure URL without file names or variables on a page can help improve the overall user experience by making the URL cleaner and easier to read. This can also enhance the security of the website by hiding specific file paths or sensitive information that may be included in the URL.

<?php
$current_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$clean_url = strtok($current_url, '?');
echo $clean_url;
?>