how to check http:// or https:// ?

From: Date: Fri, 05 Aug 2005 18:05:43 +0000
Subject: how to check http:// or https:// ?
Groups: php.general 
Request: Send a blank email to php-general+get-220081@lists.php.net to get a copy of this message
Hi, I need to check does URL use http or https? Right now I use this code: if(preg_match('/https:/', $_SERVER['SCRIPT_URI']) == false) { header('location: [URL]https://www.test.com/test.php[/URL]'); exit; } but I am sure there is much better solution. :)

« previous php.general (#220081) next »