Are there any best practices for determining SSL support in a web server using PHP?

To determine SSL support in a web server using PHP, you can check if the 'HTTPS' server variable is set to 'on'. This variable is typically set by the server when a request is made over HTTPS. By checking this variable, you can determine if SSL is being used to secure the connection.

if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on'){
    echo 'SSL is supported on this server.';
} else {
    echo 'SSL is not supported on this server.';
}