Javascript debugger
Website design
↑
getprotobyname() returns the protocol number
associated with the protocol name as per
/etc/protocols
.
<?php
$protocol = 'tcp';
$get_prot = getprotobyname($protocol);
if ($get_prot == -1) {
echo 'Invalid Protocol';
} else {
echo 'Protocol #' . $get_prot;
}
?>
getprotobynumber() |