$url = $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];

PHP
$fullURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
Source

Also in PHP: