Z-blogPHP détermine l'URL de la page actuelle

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;     	     	
}

Le code ci-dessus peut prendre en charge à la fois http ethttps

image.png

Étiquette :Z-blogPHP
Pas comme ça.1

Liens dans cet article :https://fr.finchui.com/zblog-course/13.html

Commentaires des internautes

Je suppose que vous aimez

Produits chauds
Articles chauds
Hot Tags
Étiquettes associées
FinchUI Store Edition

Partager

Copier le lien
Heures de travail : 9 : 00 - 22 : 00
Samedi et dimanche : 14h00 - 22h00
wechat
Ajouter WeChat au service client