PHP 8.5.0 Alpha 4 available for testing

Voting

: five minus five?
(Example: nine)

The Note You're Voting On

webmaster at askapache dot com
16 years ago
Here is a simple function I compiled from user-notes that works great.. any improvements?

<?php
function get_ip( $host ){
$hostip = @gethostbyname( $host );
$ip = ( $hostip == $host ) ? $host : long2ip( ip2long( $hostip ) );
//echo sprintf("Resolved %s to %s", $host, $ip);
return $ip;
}
?>

<< Back to user notes page

To Top