{"id":278,"date":"2024-10-03T08:29:18","date_gmt":"2024-10-03T07:29:18","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=278"},"modified":"2024-10-03T08:29:18","modified_gmt":"2024-10-03T07:29:18","slug":"mwnci-keys-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-keys-function\/","title":{"rendered":"Mwnci keys() Function"},"content":{"rendered":"<h2><span id=\"Syntax\" class=\"mw-headline\">Syntax<\/span><\/h2>\n<p>keys(<i><b>hash<\/b><\/i>)<\/p>\n<h2><span id=\"Description\" class=\"mw-headline\">Description<\/span><\/h2>\n<p>The <i>keys()<\/i> function will retrieve the keys from a hash and return the list in an array. The keys may only be of type <i>boolean<\/i>, <i>int<\/i>, and <i>string<\/i>.<\/p>\n<h2><span id=\"Example\" class=\"mw-headline\">Example<\/span><\/h2>\n<pre>a={\"name\":\"mwnci\",\r\n           true:1,\r\n           7:\"seven\"}\r\n\r\nprintln(keys(a))\r\n\r\nforeach k in keys(a) {\r\n    println(a[k])\r\n}\r\n\r\n\r\n[name, true, 7]\r\nmwnci\r\n1\r\nseven\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax keys(hash) Description The keys() function will retrieve the keys from a hash and return the list in an array. The keys may only be of type boolean, int, and string. Example a={&#8220;name&#8221;:&#8221;mwnci&#8221;, true:1, 7:&#8221;seven&#8221;} println(keys(a)) foreach k in keys(a) { println(a[k]) } [name, true, 7] mwnci 1 seven<\/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-278","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/278","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=278"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/278\/revisions"}],"predecessor-version":[{"id":279,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/278\/revisions\/279"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}