{"id":635,"date":"2015-06-02T12:27:57","date_gmt":"2015-06-02T12:27:57","guid":{"rendered":"https:\/\/ibex.tech\/c\/?p=635"},"modified":"2026-06-17T09:25:03","modified_gmt":"2026-06-17T08:25:03","slug":"if","status":"publish","type":"post","link":"https:\/\/ibex.tech\/c\/c\/if\/if","title":{"rendered":"if"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">If (variable)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tif (some_variable)\n\t\tdo_something;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Anything that&#8217;s not a 0 is a true value in if<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">If with load of a&nbsp;return value into a variable<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure you enclose the assignment in brackets or it won&#8217;t work correctly<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tif ((count = some_function()) &gt; -1)\n\t{\n\t\t\/\/count contains the return value\n\t}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If (variable) Anything that&#8217;s not a 0 is a true value in if If with load of a&nbsp;return value into a variable Ensure you enclose the assignment in brackets or it won&#8217;t work correctly<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[],"class_list":["post-635","post","type-post","status-publish","format-standard","hentry","category-if"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/comments?post=635"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/635\/revisions"}],"predecessor-version":[{"id":1252,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/635\/revisions\/1252"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/media?parent=635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/categories?post=635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/tags?post=635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}