English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
long2The ip() function converts a long integer to a string in the dotted internet standard format address (IPV4)。
string long2ip ( string $proper_address )
It is used to convert long integer values to IPv4Address.
Returns the IP address as a string
Number | Parameters and Description |
---|---|
1 | proper_address It contains the long integer value |
Try the following example
<?php $ip = "49.204.34.96"; $s32int = ip2long($ip); $us32str = sprintf("眻,$s32int); printf("%s %s",$us32str,long2ip(-(4294967296-$us32str))); ?>
The following code converts an IP address to a long integer and converts a long integer to an IP address
835461728 49.204.34.96