English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The inet_pton() function converts human-readable IP addresses to a compressed in_addr representation
string inet_pton ( string $address )
It is used to convert human-readable IP addresses to in_addr format
It returns an in_addr address, otherwise it will display a failure message.
Number | Parameters and descriptions |
---|---|
1 | address It contains IPv4or IPv6Address. |
Try the following example
<?php $in_addr = inet_pton('127.0.0.1'); ?>
The following code converts an IP address to an in_addr formatted address.