Hi,
Now I found out how nice and easy PHP works I'm converting all my perl script to PHP. Therefore I have the following question: does anywone know a perl-php dictionary type of website?
I'm having problems converting the following snippet:
Perl:
my $ip = $ENV{'REMOTE_ADDR'};
my $hostname = scalar(gethostbyaddr(inet_aton($ip), AF_INET));
$hostname = $1 if $hostname =~ /.*\.([^.]*\.[^.]*)/;
$in{$db_cols[$db_stats]} = "$ip / $hostname";
PHP:
$hostname = gethostbyaddr($ip);
// $hostname = ???
$display = $ip." / ".$hostname;
I would like to display something like "198.45.34.45 / isp.com" (NOT "456.45.34.23 / user45.modem12.route.isp.com")
Now I found out how nice and easy PHP works I'm converting all my perl script to PHP. Therefore I have the following question: does anywone know a perl-php dictionary type of website?
I'm having problems converting the following snippet:
Perl:
Code:
# Set statistics variable to ip and hostname. my $ip = $ENV{'REMOTE_ADDR'};
my $hostname = scalar(gethostbyaddr(inet_aton($ip), AF_INET));
$hostname = $1 if $hostname =~ /.*\.([^.]*\.[^.]*)/;
$in{$db_cols[$db_stats]} = "$ip / $hostname";
PHP:
Code:
$ip = $_SERVER['REMOTE_ADDR']; $hostname = gethostbyaddr($ip);
// $hostname = ???
$display = $ip." / ".$hostname;
I would like to display something like "198.45.34.45 / isp.com" (NOT "456.45.34.23 / user45.modem12.route.isp.com")