PHP | inet_ntop() Function Last Updated : 05 Sep, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The inet_ntop() function is an inbuilt function in PHP which converts a 32bit IPv4 or 128bit IPv6 address into a readable format. Syntax: string inet_ntop( string $ip_address ) Parameter: This function accepts one parameter as mentioned above and described below: $ip_address: It is required parameter. It specifies a 32bit IPv4 or 128bit IPv6 address. Return Value: This function returns a string formatted human readable address on success or FALSE on failure. Note: This function is available on PHP 5.1.0 and newer version. Below programs illustrate the inet_ntop() function in PHP: Program 1: php <?php // Store the address into variable $addr = chr(127) . chr(0) . chr(1) . chr(1); // Use inet_ntop() function to convert // internet address to a human readable // representation $exp = inet_ntop($addr); // Display result echo $exp; ?> Output: 127.0.1.1 Program 2: This program uses a string of size 4 of ascii characters directly in the parameter. php <?php // Use inet_ntop() function to convert // internet address to a human readable // representation echo inet_ntop("[][]") . "<br>"; echo inet_ntop("4509") . "<br>"; echo inet_ntop("*^b@") . "<br>"; echo inet_ntop("hqp0") . "<br>"; echo inet_ntop("2c#!"); ?> Output: 91.93.91.9352.53.48.5742.94.98.64104.113.112.4850.99.35.33 Reference: https://www.php.net/manual/en/function.inet-ntop.php Comment More infoAdvertise with us Next Article PHP IntlChar::ord() Function G gekcho Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP isset() Function The isset() function in PHP checks whether a variable is declared and not NULL. It returns true if the variable exists and has a non-NULL value, and false otherwise, without modifying the variable. Syntaxbool isset( mixed $var [, mixed $... ] )Parameters: This function accept one or more parameter a 3 min read PHP SplHeap insert() Function The SplHeap::insert() function is an inbuilt function in PHP which is used to insert an element in the heap by sifting it up. Generally, the Heap Data Structure are of two types: Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of its children. 2 min read PHP | inet_pton() Function The inet_pton() function is an inbuilt function in PHP which converts a readable format IP address into a packed 32bit IPv4 or 128bit IPv6 address. Syntax: string inet_pton( string $ip_address ) Parameters: This function accepts single parameter as mentioned above and described below: $ip_address: I 1 min read PHP IntlChar::ord() Function The IntlChar::ord() function is an inbuilt function in PHP which is used to return the Unicode code point value of the given character. Syntax: int IntlChar::ord( $character ) Parameters: This function accepts a single parameter $character which is mandatory. This parameter is a Unicode character. R 2 min read PHP IntlChar::ord() Function The IntlChar::ord() function is an inbuilt function in PHP which is used to return the Unicode code point value of the given character. Syntax: int IntlChar::ord( $character ) Parameters: This function accepts a single parameter $character which is mandatory. This parameter is a Unicode character. R 2 min read PHP | idate() Function The idate() function is an inbuilt function in PHP which is used to format a local time/date as an integer. The $format and $timestamp are sent as parameters to the idate() function and it returns an integer formatted according to the specified format using the given timestamp. Unlike the function d 2 min read Like