Obtener la URL que se esta visitando con PHP

Con esta función, se puede saber la URL que se está visitando… y no hay nada más que decir, sólo la función y un ejemplo. function selfURL(){ $s = empty($_SERVER[«HTTPS»]) ? » : ($_SERVER[«HTTPS»] == «on») ? «s» : «»; $protocol = strleft(strtolower($_SERVER[«SERVER_PROTOCOL»]), «/»).$s; $port = ($_SERVER[«SERVER_PORT»] == «80») ? «» : («:».$_SERVER[«SERVER_PORT»]); return $protocol.»://».$_SERVER[‘SERVER_NAME’].$port.$_SERVER[‘REQUEST_URI’]; […]

Leer más