Posted By

focal55 on 10/19/11


Tagged

url php format


Versions (?)

PHP link href formatter


 / Published in: PHP
 

  1. <?php
  2. $url = "blahblah.com";
  3. // to clarify, this shouldn't be === false, but rather !== 0
  4. if (0 !== strpos($url, 'http://') && 0 !== strpos($url, 'https://')) {
  5. $url = "http://{$url}";
  6. }
  7. ?>

Report this snippet  

You need to login to post a comment.