ResumesInn
Welcome  ,
Interview Questions >> PHP >> What is the difference between "==" (equal) and "===" (identical) comparison operators in PHP ?
Next Question Previous Question

What is the difference between "==" (equal) and "===" (identical) comparison operators in PHP ?



  Joseph Ranjan wrote ...
The difference between the two is that "==" should be used to check if the values of the two operands are equal or not. On the other hand, "===" checks the values as well as the type of operands.

ex.

<?php
if("22" == 22)
echo "YES";
else
echo "NO";
?>

Output : YES

<?php
if("22" === 22)
echo "YES";
else
echo "NO";
?>

Output : NO




Login to write answer for this question !
Want to place your ads in this website ?
50USD Per Month for single placement. Contact Us
All Rights Reserved . Developed by SJRANJAN