php man page for getprotobyname

Query: getprotobyname

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

GETPROTOBYNAME(3)							 1							 GETPROTOBYNAME(3)

getprotobyname - Get protocol number associated with protocol name

SYNOPSIS
int getprotobyname (string $name)
DESCRIPTION
getprotobyname(3) returns the protocol number associated with the protocol $name as per /etc/protocols.
PARAMETERS
o $name - The protocol name.
RETURN VALUES
Returns the protocol number, or FALSE on failure.
EXAMPLES
Example #1 getprotobyname(3) example <?php $protocol = 'tcp'; $get_prot = getprotobyname($protocol); if ($get_prot === FALSE) { echo 'Invalid Protocol'; } else { echo 'Protocol #' . $get_prot; } ?>
SEE ALSO
getprotobynumber(3). PHP Documentation Group GETPROTOBYNAME(3)
Related Man Pages
getprotoent(3) - osx
getprotobynumber(3) - mojave
setprotoent(3) - redhat
endprotoent(3) - netbsd
setprotoent(3) - netbsd
Similar Topics in the Unix Linux Community
getprotobyname replacement?