To get the current page full url, You need to use superglobal variable $_SERVER. The $_SERVER is a built-in variable of PHP, which is used to get the current page URL. It is a superglobal variable, means it is always available in all scope
<?php
$protocol = ((!emptyempty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$full_url= $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
echo $full_url;
?>
HYPER ERA PVT.LTD | TERMS & CONDITIONS