getprotobynumber

mixed getprotobynumber(int port_number) 

Gets the protocol name for a protocol number.

Returns:

Name of the protocol; FALSE on error

Description:

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. If you’re looking for port-to-service mapping (that is, port 80 is HTTP), see getservbyport().

Information on the protocol names and corresponding numbers can be found in RFC 1340 and your system’s /etc/protocol or c:\windows\protocol file (if present).

Availability:

UNIX, Windows

Version:

4.0b4+

See also:

getprotobyname() 

Example:

23.10. Find which protocols are assigned to the first 255 available protocol numbers

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.