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

search for in the

getservbyname> <getprotobyname
Last updated: Sun, 25 Nov 2007

view this page in

getprotobynumber

(PHP 4, PHP 5)

getprotobynumber — 프로토콜 번호와 조합된 프로토콜의 이름을 가져옵니다.

Description

string getprotobynumber ( int $number )

getprotobynumber() 은 /etc/protocols 각 프로토콜 number 와 조합이 된 프로토콜의 이름을 반환합니다.

참조: getprotobyname().



add a note add a note User Contributed Notes
getprotobynumber
Vipindas K.S
08-May-2008 08:39
getprotobynumber()
=====================
getprotobynumber() gets the protocol name for the given protocol number on the local system. If the protocol number is not recognized,the function returns FALSE.The given code snippet gives the list of protocols along with their protocol numbers

<?
$format = "%6s %s\n<br />";
for ($number = 0; $number < 255; $number++)
 {
   if (getprotobynumber ($number))

      printf ($format, " $number-->", getprotobynumber ($number));
 }

?>

OUTPUT:

0--> ip
1--> icmp
3--> ggp
6--> tcp
8--> egp
12--> pup
17--> udp
20--> hmp
22--> xns-idp
27--> rdp
66--> rvd

getservbyname> <getprotobyname
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites