Menu Riverview Church

GETSERVBYNAME

Get port number associated with an Internet service and protocol

SYNTAX

getservbyname ( string $service , string $protocol ) : int

PARAMETERS

service

The Internet service name, as a string.

protocol

protocol is either "tcp" or "udp" (in lowercase).

RETURN

Returns the port number, or FALSE if service or protocol is not found.

EXAMPLES

SERVICE PROTOCOL

80

1

finger: 79
ftp: 21
gopher: 70
http: 80
imap: 143
nicname: 43
pop3: 110
smtp: 25
ssh: 22
telnet: 23
www: 80

PHP