Simply put, I need to check if the string in the $ url variable is simple http, if so, replace it with https - but I can't get it to work - any ideas:
$url="http://www.google.com"; // example http url
$url_replaced = preg_replace( '#^http://#','https://', $url ); // replace http with https
Hooray!
source
share