Posted By

newsok on 10/26/10


Tagged

name domain


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

voove


Validate Domain Name


 / Published in: PHP
 

  1. $url = "http://komunitasweb.com/";
  2. if (preg_match('/^(http|https|ftp)://([A-Z0-9][A-Z0-9_-]*(?:.[A-Z0-9][A-Z0-9_-]*)+):?(d+)?/?/i', $url)) {
  3. echo "Your url is ok.";
  4. } else {
  5. echo "Wrong url.";
  6. }

Report this snippet  

You need to login to post a comment.