Script php untuk mengambil domain dari url



Script php untuk mengambil domain dari url - Kali ini saya akan berbagi sebuah script php sederhana yang mudah mudahan bisa bermanfaat. Script php tersebut adalah Script php untuk mengambil domain dari url. Script ini sangat berguna untuk membuat tools auto dorking. Jadi ketika robot ngedorking pasti kan akan mengambil URL. Tetapi kita hanya perlu domainnya saja tanpa embel embel dibelakangannya. 

Bagaimana cara mengambil domain dari sebuah url ? script inilah yang dapat membantu.



function getDomainName($url){
$pieces = parse_url($url);
$domain = isset($pieces['host']) ? $pieces['host'] : '';
if(preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)){
return $regs['domain'];
}
return FALSE;
}

echo getDomainName("http://site .com"); // outputs '
site .com'
echo getDomainName("http://www.3xploi7.blogspot.com"); // outputs '
3xploi7.blogspot.com'
echo getDomainName("http://contoh.co"); // outputs '
contoh.co'










Sekian artikel Script php untuk mengambil domain dari url, Semoga bermanfaat buat tools creator :D 

Share this:

ABOUT THE AUTHOR

Ceyron Louis

Hello We are OddThemes, Our name came from the fact that we are UNIQUE. We specialize in designing premium looking fully customizable highly responsive blogger templates. We at OddThemes do carry a philosophy that: Nothing Is Impossible

    Blogger Comment
    Facebook Comment

0 komentar:

Posting Komentar

Arsip Blog