PHP | inet_ntop() Function Last Updated : 05 Sep, 2019 Comments Improve Suggest changes 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 | inet_ntop() 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 linkinfo() Function The linkinfo() function is an inbuilt function in PHP that retrieves information related to the links. This function checks the link is pointed to by the path that exists. Syntax: linkinfo(string $path)Parameter: This function accepts one parameter that is described below: $path: Â This parameter spe 1 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 | 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 PHP | IntlChar::iscntrl() Function The IntlChar::iscntrl() function is an inbuilt function in PHP which is used to check the given input is a control character or not. Control characters are line feed, tab, escape, etc. A control character is one of the following types: ISO 8-bit control character (U+0000..U+001f and U+007f..U+009f)I 2 min read PHP | IntlChar::isprint() Function The IntlChar::isprint() function is an inbuilt function in PHP which is used to check whether the given input character is a printable character or not. Syntax: bool IntlChar::isprint( $codepoint ) Parameters: This function accepts a single parameter $codepoint which is mandatory. The input paramete 2 min read PHP key() Function The key() function is an inbuilt function in PHP which is used to return the index of the element of a given array to which the internal pointer is currently pointing. The current element may be starting or next element which depends on the cursor position. By default cursor position is at zero inde 2 min read PHP | IntlChar::isISOControl() Function The IntlChar::isISOControl() function is an inbuilt function in PHP which is used to check whether the input code point is an ISO control code character or not. Specified code point to be determined whether the code point is ISO control code. It is True for general category "Cc" as U+0000...U+001f a 2 min read Like