Map a network – PTR / reverse DNS values [php]

<?PHP
 
$start = '149.3.176.1';
$end = '149.3.177.254';
 
$first_ip = ip2long($start);
$last_ip = ip2long($end);
$current_ip = ip2long($start);
 
if($last_ip <= $first_ip){
	die('I saved you from an infinite loop.');
	exit;
}
 
echo "IP\t\tREVERSE\n";
while ($current_ip < $last_ip){
	echo long2ip($current_ip)."\t\t".gethostbyaddr(long2ip($current_ip))."\n";
	$current_ip++;
}
 
?>