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

search for in the

header_register_callback> <getservbyname
[edit] Last updated: Fri, 25 May 2012

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 03: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 29-Nov-2000 05:00
Example:
<?php $value = getservbyport(137, "udp"); ?>

The same goes for getservbyname()

 
show source | credits | sitemap | contact | advertising | mirror sites