Same method with cleaner output.
Standard output: 242690hfc113.tampabay.rr.com
Cleaner output: *.tampabay.rr.com
<?php
$ip = $REMOTE_ADDR;
$host = gethostbyaddr($ip);
$real_host = chop($host);
if ($real_host) {
$host_arr = explode(".", $real_host);
$count = count($host_arr);
if ($count > 1) {
if (intval($host_arr[$count-1]) != 0) {
$host = substr($real_host, 0, strrpos($real_host, ".")).".*";
} else {
$host = "*".strstr($real_host, ".");
}
} else {
$host = $real_host;
}
} else {
$host = "";
}
?>
Your IP address is <?php echo $ip; ?> | Your host is <?php echo $host; ?>
This would all return something like this:
Your IP address is 24.26.90.113 | Your host is *.tampabay.rr.com