How to check if SSL is working fine on a site

To check if SSL is working fine on a site use the following php code on a test file and check it with https.

<?php
if($_SERVER['HTTPS']){
echo 'You have initiated an SSL connection. You are secured';
}else{
echo 'You have initiated a NON-SSL connection. You are not secured';
}
?>

If SSL is working fine, it will result, “You have initiated an SSL connection. You are secured”.