And Operator (&&)
"&&" operator is used to take the union of two or more conditions and returns true if and only if all the conditions are true.
<?php $a=5; $b=6; if ($a==5 && $b==6) echo "true"; //Outputs true ?>Or Operator (||)
"||" operator returns true if any of the condition is true.
<?php $a=5; $b=6; if ($a==5 || $b==5) echo "true"; //Outputs true ?>Not Operator (!)
"!" operator returns true when no condition is true.
<?php $a=5; $b=6; if !($a==$b) echo "true"; //Outputs true ?>Well that is all we need to know about Operators in php, keep reading and feel free to ask questions through comments.
![next](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimQQriEr7mTlTN2OyVws0efWgc00XE3w19PiqW5fHvcMBeftf49fvV7bNimVrFtDIA2C5MJOU79E9NXIEsqanpd59slrcx-g9SCdGwJKoMbssXXGZs633KAW8Md5siOBnytUnWuls51Ow/s1600/previousIcon.gif)
![next](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK81BWFDC3jYQwFHIwDiGyQIfqSk7zdXhlFW9cbN8YyMuMMEcnGpuslzKFElby6QJfn2_f0ogcyzBygLSeJkna5cPT23QBlu3uZjh0knmblLwq7THtCdKP1-XaZTEmO_ikFKv8ytgRPmI/s1600/nextIcon.gif)
No comments:
Post a Comment