getservbyname: get server by name
<?php echo "HTTP's default port number is: ".getservbyname("http", "tcp"); ?>