title: PHP - replace http with https in URL
body: <p>I am trying to figure out how to add s after HTTP once a user checks a box in the html form.</p>
  
  <p>I have in my PHP,</p>
  
  <pre><code>$url = 'http://google.com';
  
  if(!isset($_POST['https'])) { 
    //something here
  }
  </code></pre>
  
  <p>So basically, when the user checks a box with the name="https" i want to add s to $url's http making it <a href="https://google.com" rel="noreferrer">https://google.com</a>.</p>
  
  <p>I have little knowledge on PHP and if someone can explain to me how to go about doing this, this would be really helpful! thanks.</p>