{"id":755,"date":"2024-11-26T04:46:21","date_gmt":"2024-11-26T04:46:21","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=755"},"modified":"2024-11-26T04:46:21","modified_gmt":"2024-11-26T04:46:21","slug":"mwnci-splithostport-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-splithostport-function\/","title":{"rendered":"Mwnci splithostport() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>splithostport<strong>(<em>string<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>splithostport()<\/i> function splits a network address of the form &#8220;host:port&#8221;, &#8220;host%zone:port&#8221;, &#8220;[host]:port&#8221; or &#8220;[host%zone]:port&#8221; into an array containing host or host%zone and port.<\/p>\n<h2>Example<\/h2>\n<pre>\r\nprintln(splithostport(\"127.0.0.1:80\"))\r\nprintln(splithostport(\"[::1]:443\"))\r\n\r\n\r\n[\"127.0.0.1\", \"80\"]\r\n[\"::1\", \"443\"]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax splithostport(string) Description The splithostport() function splits a network address of the form &#8220;host:port&#8221;, &#8220;host%zone:port&#8221;, &#8220;[host]:port&#8221; or &#8220;[host%zone]:port&#8221; into an array containing host or host%zone and port. Example println(splithostport(&#8220;127.0.0.1:80&#8221;)) println(splithostport(&#8220;[::1]:443&#8221;)) [&#8220;127.0.0.1&#8221;, &#8220;80&#8221;] [&#8220;::1&#8221;, &#8220;443&#8221;]<\/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-755","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/755","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=755"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/755\/revisions"}],"predecessor-version":[{"id":756,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/755\/revisions\/756"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}