fork download
  1. <?php
  2. $url = "http://www.google.com";
  3. echo preg_match("/^http(s?):\/\/(\w+\.)?\w+\-?\.\w{2,6}(.*)?$/", $url) ? "<a href = '$url'>$url</a>" : $url;
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
<a href = 'http://www.google.com'>http://www.google.com</a>