Possible Duplicate:
Check if the url is contains the http or https
What is the code to figure out whether the given URL contains http:// or https:// at the beginning using PHP and regular expressions?
Possible Duplicate:
Check if the url is contains the http or https
What is the code to figure out whether the given URL contains http:// or https:// at the beginning using PHP and regular expressions?
you can use parse_url
<?php
$url = parse_url('https://example.org');
if ($url['scheme'] == 'https') {
// is https;
}
?>
Maybe this could help
$_SERVER['SERVER_PROTOCOL'];
strposdocumentation, first example.