{"id":299,"date":"2018-01-11T07:33:41","date_gmt":"2018-01-11T07:33:41","guid":{"rendered":"http:\/\/mddir.com\/how-to\/?p=299"},"modified":"2018-01-11T07:33:41","modified_gmt":"2018-01-11T07:33:41","slug":"php-if-statement","status":"publish","type":"post","link":"https:\/\/www.mddir.com\/how-to\/php-if-statement\/","title":{"rendered":"PHP if Statement"},"content":{"rendered":"<p>The php if statement is used to execute certain code if the condition is true. You can ask php to run the next code if a certain condition is a mention as you expected.<\/p>\n<p>Example:<\/p>\n<p>[php]&lt;?php<br \/>\n$t = &quot;25&quot;;<\/p>\n<p>if ($t == &quot;25&quot;) {<br \/>\n    echo &quot;Have a good day!&quot;;<br \/>\n}<br \/>\n?&gt;[\/php]<\/p>\n<p>In the above code, the <code>$t<\/code> has assigned the value of <code>25<\/code>. We have to ask php script to run the echo statement &#8220;<code>Have a good day<\/code>&#8221; if the $t matches the above variable.<\/p>\n<p>In the code, if statement <code>$t<\/code> is matching the variable <code>$25<\/code>. It means the echo statement will render the given text successfully in the browser.<\/p>\n<p>The outcome of the above statement will be.<\/p>\n<p><code>Have a good day!<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The php if statement is used to execute certain code if the condition is true. You can ask php to run the next code if<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-299","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/comments?post=299"}],"version-history":[{"count":1,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":300,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/299\/revisions\/300"}],"wp:attachment":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/media?parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/categories?post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/tags?post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}