September 2001
Intermediate to advanced
768 pages
32h 45m
English
mixed getservbyport( int port, string protocol_type)
| port | Name of the service |
| protocol_type | Name of the protocol; either tcp or udp |
Gets the name of a service running on a port.
Returns: Service name; FALSE on error
Description: getservbyport() returns the name of the service running on a port under the given protocol, as defined in your system’s /etc/services or c:\windows\services file. If the protocol is not recognized, the function returns FALSE.
Availability:
UNIX, Windows
Version:
4.0b4+
See also:
getservbyname()
Example:
<?php $port = 23; $protocol = 'tcp'; $service = getservbyport ($port, $protocol) or die ("No service is assigned to port $port using the $protocol ... |
Read now
Unlock full access