自分自身のURLを取得

if ( isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on' ) {
	$protocol = 'https://';
} else {
	$protocol = 'http://';
}

$url  = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

Follow me!