## $strUrl = "https://www.test.com"; if(substr($strUrl, 0, 6) === 'https:'){ echo "hasPrefix https"; }