Current Location: Home> Function Categories> getservbyport

getservbyport

Get Internet services corresponding to ports and protocols
Name:getservbyport
Category:Network
Programming Language:php
One-line Description:Returns the Internet service for the given port and protocol.

Definition and usage

getservbyport() function returns the Internet service name of the given port and protocol.

Example

An example of getservbyport() :

 <?php
$intservname = getservbyport ( 80 , "tcp" ) ;
echo $intservname ;
?>

grammar

 getservbyport ( port , protocol )

Parameter value

parameter describe
port Required. Specify the port number (such as 80).
protocol Required. Specify a protocol name (such as "tcp" or "udp").
Similar Functions
Popular Articles