PHP checks whether server SSL is enabled, that is, whether HTTPS connections are supported.
Use the php function to check whether the server supports SSL (HTTPS connection). The specific function code is as follows. For more information about how to enable SSL support, refer to this article:
Php checks whether server SSL is enabled and how to enable SSL
/** Check whether the server supports SSL connections (Https connections) * @ return bool */function is_SSL () {if (! Isset ($ _ SERVER ['https']) return FALSE; if ($ _ SERVER ['https'] = 1) {// Apachereturn TRUE ;} elseif ($ _ SERVER ['https'] === 'on') {// IISreturn TRUE;} elseif ($ _ SERVER ['server _ port'] = 443) {// other return TRUE;} return FALSE ;}
For example:
Echo is_SSL ()? 'Supported ': 'unsupported ';
Articles you may be interested in
- Php determines whether the string is full of English, pure Chinese, and a combination of Chinese and English
- Php checks whether server SSL is enabled and how to enable SSL
- Summary of methods for php to determine whether the date format is correct
- How do I know whether the server supports Gzip compression?
- PHP allows multiple second-level domain names on the same server to share SESSION data
- How does php determine whether the current operating system is linux or windows?
- Php methods to determine whether a remote file exists
- Php performance optimization: Using isset () to determine the string length is faster than strlen ()