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

search for in the

header_remove> <getservbyname
Last updated: Fri, 06 Nov 2009

view this page in

getservbyport

(PHP 4, PHP 5)

getservbyportポートおよびプロトコルに対応するインターネットサービスを得る

説明

string getservbyport ( int $port , string $protocol )

getservbyport() は、 /etc/services に基づき 指定したプロトコル protocol に関してポート port に関連するインターネットサービスを返します。

パラメータ

port

ポート番号。

protocol

protocol"tcp" あるいは "udp" (小文字) のいずれかです。

返り値

インターネットサービス名を文字列で返します。

参考

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



add a note add a note User Contributed Notes
getservbyport
q9603062 at topaz dot cqu dot edu dot au
16-Jan-2001 07:28
Like the previous post of palands, the protcol tcp must be in lower case, either quoted or unquoted..

Example:
$value=getservbyport(31337, "tcp");

Uppercase will not work.
paland at stetson dot edu
30-Nov-2000 09:00
Example:
<?php $value = getservbyport(137, "udp"); ?>

The same goes for getservbyname()

header_remove> <getservbyname
Last updated: Fri, 06 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites