Get Current Page URL PHP
There is a few methods of getting this but here is a simple one. Replacing the http or https manually.
$current_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Here is a more complex version of this that can check if there is http or https in the current url.
$current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";