Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: getservbyname - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

getservbyport" width="11" height="7"/> <getprotobynumber
Last updated: Thu, 31 May 2007

view this page in

getservbyname

(PHP 4, PHP 5)

getservbyname — インターネットサービスおよびプロトコルが関連するポート番号を得る

説明

int getservbyname ( string $service, string $protocol )

getservbyname() は、/etc/services に基づき 指定したプロトコル protocol に関して service に対応するインターネットポートを 返します。 protocol は、"tcp"(小文字) または "udp"(小文字)である必要があります。 service あるいは protocol が見つからなかった場合は FALSE を返します。

例 1552. getservbyname() の例

<?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";
}
?>

ポート番号の完全なリストは http://www.iana.org/assignments/port-numbers を参照ください。

getservbyport() も参照ください。



add a note add a note User Contributed Notes
getservbyname
There are no user contributed notes for this page.

getservbyport" width="11" height="7"/> <getprotobynumber
Last updated: Thu, 31 May 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites