PHP: getprotobyname - Manual

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

search for in the

getprotobynumber getmxrr

Last updated: Sat, 27 Jan 2007

view this page in

# getprotobyname

(PHP 4, PHP 5)

getprotobyname -- Get protocol number associated with protocol name

## Description

int getprotobyname ( string name )

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

Пример 1. getprotobyname() example

`<?php
$protocol = 'tcp';
$get_prot = getprotobyname($protocol);
if ($get_prot == -1) {
// if nothing found, returns -1
echo 'Invalid Protocol';
} else {
echo 'Protocol #' . $get_prot;
}
?>`

See also: getprotobynumber().

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

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST