<?php
/**
*
* @get the full url of page
*
* @return string
*
*/
function getAddress()
{
/*** check for https ***/
$protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
/*** return the full address ***/
return $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
/*** example usage ***/
echo getAddress();
?>