PHP getprotobyname() Function

❮ PHP Network Reference

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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.