PHP getprotobyname() Function
Example
A getprotobyname() example:
<?php
$protocolnum = getprotobyname("tcp");
echo $protocolnum;
?>
Definition and Usage
The getprotobyname() function returns the protocol number for a given protocol name.
Syntax
getprotobyname(protocolname)
Parameter Values
Parameter | Description |
---|---|
protocolname | Required. Specifies a protocol name (like "tcp") |
Technical Details
Return Value: | The protocol number on success. FALSE on failure. |
---|---|
PHP Version: | 4.0+ |
❮ PHP Network Reference