• PHP Video Tutorials

PHP - Function inet pton



Syntax

string inet_pton ( string $address )

Definition and Usage

It used to convert human readable Ip address to in_addr format

Return Values

It Returns in_addr address or else it will show a failure message.

Parameters

Sr.No Parameters & Description
1

address

it contains IPv4, or IPv6 address.

Example

Try out following example

<?php
   $in_addr = inet_pton('127.0.0.1');
?>

The above code reconverts the IP address to in_addr format address.

php_function_reference.htm
Advertisements