<?php
if ($_SERVER['HTTPS'] != "on") { 
    echo "This is not HTTPS";
}else{
    echo "This is HTTPS";
}
PHP Peachpie Snippet check HTTPS server