How To Check if the URL is HTTPS in PHP

How can I check weather URL start with https or http

You can use php native function – parse_url to check if the url is https or http
$parse_url = parse_url($url);
if($parse_url['scheme'] == 'https'){
    return true;
}

Leave a Reply

avatar
  Subscribe  
Notify of