{"id":3640,"date":"2021-02-12T09:52:03","date_gmt":"2021-02-12T09:52:03","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=3640"},"modified":"2025-04-11T21:22:00","modified_gmt":"2025-04-11T20:22:00","slug":"assign-value-in-an-if-statement","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/if\/assign-value-in-an-if-statement","title":{"rendered":"Assign value in an if statement"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">If result is not false<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  if ( ($MyVariable = MyFunctioName($Something)) !== False )\n  {\n  }<\/code><\/pre>\n\n\n\n<p><strong><em>Note &#8211; make sure you surround the assignment and function call in brackets or it doesn&#8217;t work!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If result is not false Note &#8211; make sure you surround the assignment and function call in brackets or it doesn&#8217;t work!<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,25],"tags":[],"class_list":["post-3640","post","type-post","status-publish","format-standard","hentry","category-functions","category-if"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3640","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=3640"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3640\/revisions"}],"predecessor-version":[{"id":3651,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3640\/revisions\/3651"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=3640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=3640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=3640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}