{"id":141,"date":"2024-09-29T07:30:35","date_gmt":"2024-09-29T06:30:35","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=141"},"modified":"2024-09-29T07:30:35","modified_gmt":"2024-09-29T06:30:35","slug":"mwnci-bool-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-bool-function\/","title":{"rendered":"Mwnci bool() Function"},"content":{"rendered":"<h2><span id=\"Syntax\" class=\"mw-headline\">Syntax<\/span><\/h2>\n<p>bool(<em><b>value<\/b><\/em>)<\/p>\n<h2><span id=\"Description\" class=\"mw-headline\">Description<\/span><\/h2>\n<p><i>bool()<\/i> converts <b>value<\/b> to a <b>bool<\/b>.<\/p>\n<ul>\n<li><b>integer\/float<\/b>: Returns <i>true<\/i> for non-zero, <i>false<\/i> otherwise.<\/li>\n<li><b>array\/hash\/string<\/b>: Returns <i>true<\/i> if non-empty, <i>false<\/i> otherwise.<\/li>\n<li><b>Boolean<\/b>: Returns the value directly<\/li>\n<\/ul>\n<p>Any other <b>type<\/b> or <b>value<\/b> will return <i>false<\/i><\/p>\n<h2><span id=\"Example\" class=\"mw-headline\">Example<\/span><\/h2>\n<pre>a=\"fred\"\r\nprintln(bool(a))\r\n\r\ntrue\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax bool(value) Description bool() converts value to a bool. integer\/float: Returns true for non-zero, false otherwise. array\/hash\/string: Returns true if non-empty, false otherwise. Boolean: Returns the value directly Any other type or value will return false Example a=&#8221;fred&#8221; println(bool(a)) true<\/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-141","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/141","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=141"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/141\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/141\/revisions\/142"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}