How can one access the full URL displayed in the address bar using PHP?

To access the full URL displayed in the address bar using PHP, you can use the $_SERVER['REQUEST_URI'] variable. This variable contains the path and query string of the current URL. You can concatenate this with other server variables like $_SERVER['HTTP_HOST'] to get the full URL.

$fullUrl = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
echo $fullUrl;