PHP- Check domain name from url
by barkkathulla[ Edit ] 2014-03-14 18:05:12
Using PHP we can get domain name from given url...
$image_name="input url";
preg_match('@^(https?://)?([a-z0-9_-]+\.)*([a-z0-9_-]+)\.[a-z]{2,6}(/.*)?$@i',$image_name,$match);
$domain = $match[3];
This is very useful in blocked sites validation purpose....