{"id":3136,"date":"2019-06-13T00:02:57","date_gmt":"2019-06-13T00:02:57","guid":{"rendered":"http:\/\/softlect.in\/?p=3136"},"modified":"2019-06-13T00:36:08","modified_gmt":"2019-06-13T00:36:08","slug":"php-operators","status":"publish","type":"post","link":"http:\/\/softlect.com\/index.php\/php-operators\/","title":{"rendered":"PHP Operators"},"content":{"rendered":"<p>Arithmetic Operators:<\/p>\n<p>+ , &#8211; , * , \/ , % , ++ and \u2013<\/p>\n<p>&nbsp;<\/p>\n<p>For \/ the result is always double<\/p>\n<p>For % the operands must be integers else they are coerced to integers<\/p>\n<p>&nbsp;<\/p>\n<p>Assignment Operators:<\/p>\n<p>+=\u00a0 and \/=<\/p>\n<p>&nbsp;<\/p>\n<p>Predefined functions on numeric values<\/p>\n<p>floor()<\/p>\n<p>ceil()<\/p>\n<p>round()<\/p>\n<p>rand()\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 two parameters<\/p>\n<p>abs()<\/p>\n<p>min()\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 one or more parameters<\/p>\n<p>max()\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 one or more parameters<\/p>\n<p>&nbsp;<\/p>\n<p>The other predefined functions are used for computing exponents, logarithms, trigonometric functions.<\/p>\n<p>&nbsp;<\/p>\n<p>Relational Operators<\/p>\n<p>PHP has eight relational operators<\/p>\n<p>== , != , &lt;, &lt;=, &gt; , &gt;=.<\/p>\n<p>=== \u00a0\u00a0 is true only if both the operands are the same type and have same value<\/p>\n<p>!== \u00a0\u00a0\u00a0 is exactly opposite to ===<\/p>\n<p>&nbsp;<\/p>\n<p>If the type of the operands of the relational operator are not same then coercion occurs.<\/p>\n<p>if the string is compared with numbers, and if string can be converted to number then numeric comparison will be performed. If the string cannot be converted to number then the number operand is converted to a string and string comparison will be performed.<\/p>\n<p>Boolean Operators:<\/p>\n<p>PHP has six Boolean operators:<\/p>\n<p>and , or , xor , ! , &amp;&amp; and ||<\/p>\n<p>&nbsp;<\/p>\n<p>The and and &amp;&amp; will perform the same operation as well as or and || will also perform the same operation. The only difference between them is the precedence.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arithmetic Operators: + , &#8211; , * , \/ , % , ++ and \u2013 &nbsp; For \/ the result is always double For % the operands must be integers&hellip; <\/p>\n","protected":false},"author":1,"featured_media":3170,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[82],"tags":[],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts\/3136"}],"collection":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/comments?post=3136"}],"version-history":[{"count":2,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts\/3136\/revisions"}],"predecessor-version":[{"id":3160,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts\/3136\/revisions\/3160"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/media\/3170"}],"wp:attachment":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/media?parent=3136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/categories?post=3136"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/tags?post=3136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}