PHP to determine whether the server SSL is enabled, that is, to determine whether to support HTTPS connection
Through the PHP function to detect whether the server supports SSL (that is, HTTPS connection), the specific function code is as follows. Also on how to turn on SSL support can refer to this site article:
PHP detects if server SSL is turned on and SSL is turned on
/** detects if 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 ()? ' Support ': ' does not support ';
Articles you may be interested in
- PHP to determine whether the string is in English, pure Chinese, the method of combination of English
- PHP detects if server SSL is turned on and SSL is turned on
- Summary of how PHP determines the correct date format
- How to know if the server supports gzip compression
- PHP to share SESSION data with multiple level two domain name servers
- How PHP determines whether the current operating system is Linux or Windows
- PHP to determine if a remote file exists
- PHP Performance Optimizations: Use Isset () to determine string length faster than strlen ()
http://www.bkjia.com/PHPjc/982050.html www.bkjia.com true http://www.bkjia.com/PHPjc/982050.html techarticle PHP Determines whether the server SSL is enabled, that is, to determine whether to support HTTPS connection through the PHP function to detect whether the server supports SSL (that is, HTTPS connection), the specific function code is as follows. The other closed ...