- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
function get_domain ($url)
{
preg_match("/^(http:\/\/)?([^\/]+)/i",
$url, $matches);
$host = $matches[2];
// get last two segments of host name
preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches);
return $matches[0];
}
function get_host ($url)
{
preg_match("/^(http:\/\/)?([^\/]+\.[^\/]+)\/?/i",
$url, $matches);
$host = $matches[2];
return $host;
}
unu-foja 27.03.2012 23:35 # +5
guest8 09.04.2019 12:55 # −999