== Operator
"==" operator is used for comparing two values or variables and return true if they are same.
<?php $a=5; if ($a==5) echo "Five"; //Outputs Five ?>!= and <> Operator
"!=" and "<>" operators are also used for comparing two values or variables but they return true if the values are not same.
<?php $a=5; if ($a!=4) echo "Four"; //Outputs Four if ($a<>4) echo "Four"; //Outputs Four ?>> Operator
">" operator is used to check whether the first value is greater than second or not.
<?php $a=5; if ($a>4) echo "Greater"; //Outputs Greater ?>< Operator
"<" operator is used to check whether the first value is less than second or not.
<?php $a=5; if ($a<6) echo "Lesser"; //Outputs Lesser ?>>= Operator
">=" operator is used to check whether the first value is greater than or equal to the second value or not.
<?php $a=5; if ($a>=5) echo "Greater"; //Outputs Greater if ($a>=4) echo "Greater"; //Outputs Greater ?><= Operator
"<=" operator is used to check whether the first value is less than or equal to the second value or not.
<?php $a=5; if ($a<=5) echo "Lesser"; //Outputs Lesser if ($a<=6) echo "Lesser"; //Outputs Lesser ?>
Ok Guyz, that is all for this lesson, feel free to comment and ask any quries that you may have.
![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