protected function setProtocolToHttps($url)
    {
        $processUrl = trim($url);
        if (strpos($url, 'http://') === 0) {
            $processUrl = substr($processUrl, 7);
        } elseif (strpos($processUrl, 'https://') === 0) {
            $processUrl = substr($processUrl, 8);
        } elseif (strpos($processUrl, '//') === 0) {
            $processUrl = substr($processUrl, 2);
        }
        return 'https://' . $processUrl;
    }
protected function setProtocolToHttps($url)
    {
        $processUrl = trim($url);
        if (strpos($url, 'http://') === 0) {
            $processUrl = substr($processUrl, 7);
        } elseif (strpos($processUrl, 'https://') === 0) {
            $processUrl = substr($processUrl, 8);
        } elseif (strpos($processUrl, '//') === 0) {
            $processUrl = substr($processUrl, 2);
        }
        return 'https://' . $processUrl;
    }
protected function setProtocolToHttps ( $ url ) { $ processUrl = trim ( $ url ) ; if ( strpos ( $ url , 'http://' ) === 0 ) { $ processUrl = substr ( $ processUrl , 7 ) ; } elseif ( strpos ( $ processUrl , 'https://' ) === 0 ) { $ processUrl = substr ( $ processUrl , 8 ) ; } elseif ( strpos ( $ processUrl , '//' ) === 0 ) { $ processUrl = substr ( $ processUrl , 2 ) ; } return 'https://' . $ processUrl ; }
Change every protocol to https and add it if missing

@param  string $url URL
@return string
Change every protocol to https and add it if missing