Current Location: Home> Function Categories> inet_pton

inet_pton

Convert human-readable IP addresses to their compressed in_addr representation
Name:inet_pton
Category:Network
Programming Language:php
One-line Description:Converts a readable IP address to a packaged 32-bit IPv4 or 128-bit IPv6 format.

Definition and usage

inet_pton() function converts a readable IP address into a packaged 32-bit IPv4 or 128-bit IPv6 format.

Example

Convert readable IP addresses to packaged format:

 <?php
$addr = inet_pton ( "127.0.1.1" ) ;
echo $addr ;
?>

grammar

inet_pton( address )

Parameter value

parameter describe
address Required. Specifies a readable IP address.
Similar Functions
Popular Articles