string inet_ntop ( string $str )
inet_ntop() converts a string IP(IPv4) address to a human-readable IP address
※ available F/W version : all
Returns a human-readable IP address string or FALSE on invalid IP address. Otherwise PHP error
<?php
$ip1 = "192.168.0.100";
hexdump($ip1); // OUTPUT: 0000 31 39 32 2e 31 36 38 2e 30 2e 31 30 30 |192.168.0.100 |
$ip2 = inet_pton($ip1);
hexdump($ip2); // OUTPUT: 0000 c0 a8 00 64 |...d |
$ip1 = inet_ntop($ip2);
hexdump($ip1); // OUTPUT: 0000 31 39 32 2e 31 36 38 2e 30 2e 31 30 30 |192.168.0.100 |
?>
This function is identical to the PHP group’s inet_ntop().