update : 2015.11.03
php.shukuma.com

검색:
 
 
Get protocol number associated with protocol name

getprotobyname

(PHP 4, PHP 5)

getprotobynameGet protocol number associated with protocol name

설명

int getprotobyname ( string $name )

getprotobyname() returns the protocol number associated with the protocol name as per /etc/protocols.

인수

name

The protocol name.

반환값

Returns the protocol number, 실패 시 FALSE를 반환합니다.

예제

Example #1 getprotobyname() example

<?php
$protocol 
'tcp';
$get_prot getprotobyname($protocol);
if (
$get_prot === FALSE) {
    echo 
'Invalid Protocol';
} else {
    echo 
'Protocol #' $get_prot;
}
?>

참고