Check if HTTPS is available in a URL using PHP

Did you ever need to check a page if its using HTTPS or HTTPS connection is available on a site using PHP?

here you have a function that will work for you

this will return boolean true if the url has https else false