PHP判断当前网站是HTTPS还是HTTP

2021-03-31 19:27

阅读:673

标签:_for   col   判断   div   type   $_server   https   nbsp   ==   

//获取当前网站是HTTPS还是HTTP:

$http_type = ((isset($_SERVER[‘HTTPS‘]) && $_SERVER[‘HTTPS‘] == ‘on‘) || (isset($_SERVER[‘HTTP_X_FORWARDED_PROTO‘]) && $_SERVER[‘HTTP_X_FORWARDED_PROTO‘] == ‘https‘)) ? ‘https://‘ :‘http://‘;

// var_dump($http_type);

 

PHP判断当前网站是HTTPS还是HTTP

标签:_for   col   判断   div   type   $_server   https   nbsp   ==   

原文地址:https://www.cnblogs.com/web928943/p/12582368.html


评论


亲,登录后才可以留言!