getprotobyname 


Apache apg

GETS the protocol number associated with the protocol name.



<?php

int
|false getprotobyname str $protocol )


where,

$protocol The protocol name
  
?>

  $protocol   


The protocol name.



  1 EXERCISE   

<table width="100%" cellspacing="3" cellpadding="3" 
border="1" align="center"><tbody><tr><td colspan="2">PROTOCOLS</td></tr>
<tr><td >NAME</td><td>NUMBER</td></tr> 
<?php

$arr01 
= ['icmp''ggp''tcp''egp''pup''udp''hmp'
               
'xns-idp''rdp''ipv6''ipv6-route''ipv6-frag'
               
'esp''ah''ipv6-icmp''ipv6-nonxt'
               
'ipv6-opts''rvd' ];


foreach (
$arr01 as $a01) { ?> 
    </tr><td><?php echo $a01?><td>
    <?php echo getprotobyname($a01); ?></td></td></tr> 
     
<?php ?> 
</tr><tr><td colspan="2">ed48</td></tr></tbody></table>