{"id":1169,"date":"2025-05-21T13:00:41","date_gmt":"2025-05-21T12:00:41","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=1169"},"modified":"2025-05-21T13:11:29","modified_gmt":"2025-05-21T12:11:29","slug":"mwnci-lookupport-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-lookupport-function\/","title":{"rendered":"Mwnci lookupport() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>lookupport<strong>(<em>integer<\/em>, [<em>string<\/em>])<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>lookup()<\/i> function returns the service name of a given port. The ports are searched in the file <em>\/etc\/services<\/em>. If a port cannot be found, a <em>null<\/em> is returned. An optional protocol of &#8220;<em>tcp<\/em>&#8221; or &#8220;<em>udp<\/em>&#8221; can be given for a more specific call. If no protocol is given, <em>tcp<\/em> is assumed.<\/p>\n<h2>Example<\/h2>\n<pre>include(\"net\")\r\nprintln(lookupport(80, \"udp\"))\r\nprintln(lookupport(80, \"tcp\"))\r\nprintln(lookupport(80))\r\n\r\n\r\nnull\r\nhttp\r\nhttp<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax lookupport(integer, [string]) Description The lookup() function returns the service name of a given port. The ports are searched in the file \/etc\/services. If a port cannot be found, a null is returned. An optional protocol of &#8220;tcp&#8221; or &#8220;udp&#8221; can be given for a more specific call. If no protocol is given, tcp is &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-lookupport-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci lookupport() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1169","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1169"}],"version-history":[{"count":3,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1169\/revisions"}],"predecessor-version":[{"id":1172,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1169\/revisions\/1172"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}