ポート番号からポート名を取得するには、getservbyport()関数を使用します。
引数には、ポート番号とプロトコル名を指定します。

<?php
echo getservbyport('80', 'tcp').'\n';
echo getservbyport('53', 'tcp').'\n';
?>

◆実行結果
http
domain

[対象]
PHP 5.x