title: preg_replace http with https
body: <p>Put simply, I need to check if the string in the variable $url is a simple http, if so, replace it with https - but I can't get it to work - any ideas:</p>
  
  <pre><code>$url="http://www.google.com"; // example http url ##
  $url_replaced = preg_replace( '#^http://#','https://', $url ); // replace http with https ##
  </code></pre>
  
  <p>Cheers!</p>