PHP 8.5.0 Alpha 1 available for testing

Voting

: nine minus one?
(Example: nine)

The Note You're Voting On

Vipindas K.S
17 years ago
getprotobynumber()
=====================
getprotobynumber() gets the protocol name for the given protocol number on the local system. If the protocol number is not recognized,the function returns FALSE.The given code snippet gives the list of protocols along with their protocol numbers

<?
$format = "%6s %s\n<br />";
for ($number = 0; $number < 255; $number++)
{
if (getprotobynumber ($number))

printf ($format, " $number-->", getprotobynumber ($number));
}

?>

OUTPUT:

0--> ip
1--> icmp
3--> ggp
6--> tcp
8--> egp
12--> pup
17--> udp
20--> hmp
22--> xns-idp
27--> rdp
66--> rvd

<< Back to user notes page

To Top