get Http vs Https in php
In this post. I will show you How do know your server protocol that is Http or https using PHP.Coding
<?php if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { // HTTPS echo 'https'; } else { echo 'http'; // HTTP } ?> |
Output:
0 comments:
Post a Comment