• PHP Video Tutorials

PHP - Function inet ntop



Syntax

string inet_ntop ( string $in_addr )

Definition and Usage

It used to convert internet package to human readable format.

Return Values

It Returns the string value or else it will show a failure message.

Parameters

Sr.No Parameters & Description
1

in_addr

it contains a 32bit IPv4, or 128bit IPv6 address.

Example

Try out following example

<?php
   
   $packed = chr(127) . chr(0) . chr(1) . chr(1);
   $expanded = inet_ntop($packed);
   echo $expanded;
?>

This will produce following result −

127.0.1.1::1
php_function_reference.htm
Advertisements