function startsWith($haystack, $needle)
//https://stackoverflow.com/questions/834303
{
$length = strlen($needle);
return substr($haystack, 0, $length) == $needle;
}
function add_https($myUrl)
{
if(startsWith($myUrl, 'www') == true)
{
$myUrl = 'https://' . $myUrl;
}
return $myUrl;
}
echo add_https('www.bluesite.it/lozibaldoneinformatico');