PHP | getprotobynumber() Function Last Updated : 30 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The getprotobynumber() function is an inbuilt function in PHP which returns the protocol name for a specified protocol number. Syntax: string getprotobynumber( int $protocol_number ) Parameters: This function accepts single parameter $protocol_number which is required. It specifies the protocol number, like 6 for tcp, 17 for udp etc. Return Value: This function returns protocol name on success and FALSE on failure. Note: This function is available for PHP 4.0.0 and newer version. Below programs illustrate the getprotobynumber() function in PHP: Program 1: This program uses protocol number for protocol name "tcp". php <?php // The getprotobynumber() function get protocol // name associated with protocol number $protocolname = getprotobynumber(6); // Display result echo $protocolname; ?> Output: tcp Program 2: This program checking for many protocol name. php <?php // Store the protocol number in an array $protocol_number = array(6, 17, 20, 41); foreach( $protocol_number as $number ){ // The getprotobynumber() function get protocol // name associated with protocol number echo $number . ": " . getprotobynumber($number) . "<br>"; } ?> Output: 6: tcp 17: udp 20: hmp 41: ipv6 Reference: https://www.php.net/manual/en/function.getprotobynumber.php Comment More infoAdvertise with us Next Article PHP | getprotobynumber() Function G gekcho Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | getprotobyname() Function The getprotobyname() function is an inbuilt function in PHP which returns the protocol number for a specified protocol name. Syntax: int getprotobyname( string $name ) Parameters: This function accepts single parameter $name which is required. It specifies the protocol name, like tcp, icmp, udp, ip 1 min read PHP gettype() Function The PHP gettype() function returns the type of a variable as a string. It identifies the variable's data type, such as string, integer, array, boolean, etc., allowing developers to check and handle different data types dynamically.Syntax:string gettype ( $var )Parameter: This function accepts a sing 2 min read PHP | IntlChar getPropertyName() Function The IntlChar::getPropertyName() function is an inbuilt function in PHP which is used to get the Unicode name for a given property which is given in the Unicode database file PropertyAliases.txt. This function maps the property IntlChar::PROPERTY_GENERAL_CATEGORY_MASK to the synthetic names "gcm" / " 2 min read PHP | IntlChar getPropertyEnum() Function The IntlChar::getPropertyEnum() function is an inbuilt function in PHP which is used to get the property constant value for a given property name. The property name is going to be specified in PropertyAliases.txt, which is a Unicode Database file. All types of variants are recognized in this, be it 2 min read PHP | IntlChar getPropertyValueEnum() Function The IntlChar getPropertyValueEnum() function is an inbuilt function in PHP which is used to get the property value form the given value. Syntax: int IntlChar::getPropertyValueEnum( $property, $name ) Parameters: This function accepts two parameters as mentioned above and described below: $property: 1 min read PHP | is_numeric() Function The is_numeric() function is an inbuilt function in PHP which is used to check whether a variable passed in function as a parameter is a number or a numeric string or not. The function returns a boolean value. Syntax: bool is_numeric ( $var ) Parameters: The function accepts a single parameter which 2 min read PHP | Imagick getNumberImages() Function The Imagick::getNumberImages() function is an inbuilt function in PHP which is used to get the number of images in the Imagick object. This function can also be used to count the number of frames in a GIF animation. Syntax: int Imagick::getNumberImages( void ) Parameters: This function doesnât accep 1 min read PHP | IntlChar getIntPropertyMinValue() Function The IntlChar::getIntPropertyMinValue() function is an inbuilt function in PHP which is used to get the minimum value for a Unicode property. This could be used to access the information as well as manipulating the Unicode characters. For an enumerated/integer/binary Unicode property, this is going t 1 min read PHP octdec( ) Function In the earlier days of computing, octal numbers and the octal numbering system was very popular for counting inputs and outputs because as it works in counts of eight, inputs and outputs were in counts of eight, a byte at a time. Due to a wide usage of octal number system many times it happens that 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 Like