Mega Code Archive

 
Categories / Php / Network
 

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";     } ?>