Z-blogPHP determines the current page URL

function 主题id_getUrl(){     		 				
    $pageURL = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http";	$pageURL .= "://";	$pageURL .= $_SERVER["SERVER_NAME"];	if ($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") {		$pageURL .= ":" . $_SERVER["SERVER_PORT"];
	}      	$pageURL .= $_SERVER["REQUEST_URI"];    	  	 			 	
    return $pageURL;     	     	
}

The above code can support both http andhttps

image.png

t like1

Link to this article:https://en.finchui.com/zblog-course/13.html

netizens commented

guess you like

hot commodity
popular articles
hot Tags
related tags
FinchUI Store Edition Hong Kong Special Area

share

copy Link

Xinglan Studioadd friends

Working hours: 9:00-22:00
Saturday and Sunday: 14:00-22:00
wechat
Scan the code to add customer service WeChat