<? /* ipORdom -> Verifica se a url � um IP ou um Dominio leonardo_giori(BOZO){ www.gambiarra.com.br bozo@gambiarra.com.br } */ function ipORdom($str){ preg_match("/^(http:\/\/)?([^\/]+)/i",$str, $matches); $host = $matches[2]; $val = eregi_replace('[0-9,\.]','',$host); if($val==""){ return "IP"; }else{ return "DOM"; } } $dom = "http://gambiarra.com.br/index.html"; $ip = "http://192.168.0.1/index.html"; echo "$ip � um: <b>" . ipORdom($ip) . "</b><br>"; echo "$dom � um: <b>" . ipORdom($dom) . "</b>"; ?>