{"id":891,"date":"2024-12-12T13:29:26","date_gmt":"2024-12-12T13:29:26","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=891"},"modified":"2024-12-12T13:29:26","modified_gmt":"2024-12-12T13:29:26","slug":"mwnci-head-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-head-function\/","title":{"rendered":"Mwnci head() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>head<strong>(<em>string<\/em>|<em>array<\/em>, <em>integer<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>head()<\/i> function returns the designated amount if lines from a string, or first amount of elements from an array.<\/p>\n<p>Lines in a string are deemed to be separated by a newline (\\n)<\/p>\n<h2>Example<\/h2>\n<p>MyString=&#8221;One\\n2\\nThree Four\\n5\\nSix&#8221;<br \/>\nMyArray=[&#8220;One&#8221;, 2, &#8220;Three&#8221;, &#8220;Four Five&#8221;, &#8220;six&#8221;]<br \/>\nprintln(head(MyString, 3))<br \/>\nprintln(head(MyArray,4))<\/p>\n<p>One<br \/>\n2<br \/>\nThree Four<br \/>\n[&#8220;One&#8221;, 2, &#8220;Three&#8221;, &#8220;Four Five&#8221;]\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax head(string|array, integer) Description The head() function returns the designated amount if lines from a string, or first amount of elements from an array. Lines in a string are deemed to be separated by a newline (\\n) Example MyString=&#8221;One\\n2\\nThree Four\\n5\\nSix&#8221; MyArray=[&#8220;One&#8221;, 2, &#8220;Three&#8221;, &#8220;Four Five&#8221;, &#8220;six&#8221;] println(head(MyString, 3)) println(head(MyArray,4)) One 2 Three Four [&#8220;One&#8221;, 2, &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-head-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci head() 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-891","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/891","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=891"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/891\/revisions"}],"predecessor-version":[{"id":892,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/891\/revisions\/892"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}