vikela Posted May 6, 2009 Share Posted May 6, 2009 i am trying to figure out what does the following code and how best i can shorten it?it is part of a flash poll code. $URL = ''; $URL .= (($_SERVER['HTTPS'] != '') ? "https://" : "http://"); $URL .= (($www == true && !preg_match("/^www\./", $_SERVER['HTTP_HOST'])) ? 'www.'.$_SERVER['HTTP_HOST'] : $_SERVER['HTTP_HOST']); Link to comment https://forums.phpfreaks.com/topic/157089-https-necessary-or-not/ Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 $url = 'http' . ((!empty($_SERVER['HTTPS']))? 's' : '') . '://' . (($www && strpos($_SERVER['HTTP_HOST']) !== false)? 'www.' : '') . $_SERVER['HTTP_HOST']; Link to comment https://forums.phpfreaks.com/topic/157089-https-necessary-or-not/#findComment-827472 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.