Using getprotobynumber() : getprotobynumber « Network « PHP
- PHP
- Network
- getprotobynumber
Using getprotobynumber()
<?php
$proto_num = SOL_TCP;
$proto = getprotobynumber($proto_num);
if($proto === false) {
die("Could not find protocol with ID $proto_num\n");
} else {
echo "The protocol with ID $proto_num is '$proto'\n";
}
?>
Related examples in the same category