Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Network Functions : getservbyname

getservbyname

Get port number associated with an Internet service and protocol (PHP 4, PHP 5)
int getservbyname ( string service, string protocol )

Example 1599. getservbyname() example

<?php
$services
= array('http', 'ftp', 'ssh', 'telnet', 'imap',
'smtp', 'nicname', 'gopher', 'finger', 'pop3', 'www');

foreach (
$services as $service) {
   
$port = getservbyname($service, 'tcp');
   echo
$service . ": " . $port . "<br />\n";
}
?>

Related Examples ( Source code ) » getservbyname


Change Language


Follow Navioo On Twitter
checkdnsrr
closelog
debugger_off
debugger_on
define_syslog_variables
dns_check_record
dns_get_mx
dns_get_record
fsockopen
gethostbyaddr
gethostbyname
gethostbynamel
getmxrr
getprotobyname
getprotobynumber
getservbyname
getservbyport
header
headers_list
headers_sent
inet_ntop
inet_pton
ip2long
long2ip
openlog
pfsockopen
setcookie
setrawcookie
socket_get_status
socket_set_blocking
socket_set_timeout
syslog
eXTReMe Tracker