gevo12321 Posted December 12, 2008 Share Posted December 12, 2008 you know how in if statements you have to use == because you r comparing do you also use !== or do u use just != in if statements Link to comment https://forums.phpfreaks.com/topic/136739-solved-quick-question/ Share on other sites More sharing options...
The Little Guy Posted December 12, 2008 Share Posted December 12, 2008 depends. 1 === "1" evaluates false 1 !== "1" evaluates true Link to comment https://forums.phpfreaks.com/topic/136739-solved-quick-question/#findComment-714118 Share on other sites More sharing options...
gevans Posted December 12, 2008 Share Posted December 12, 2008 you can use != this will just compare the two variables !== will do an exact comparison, comparing the variable and variable type Link to comment https://forums.phpfreaks.com/topic/136739-solved-quick-question/#findComment-714122 Share on other sites More sharing options...
The Little Guy Posted December 12, 2008 Share Posted December 12, 2008 you can use != this will just compare the two variables !== will do an exact comparison, comparing the variable and variable type so that means if it compares a string to a interger, such as this: if(1 !== "1") echo 'here 2'; it will echo out "here 2" because an integer does not equal a string even thought they are both 1. if you don't have the triple comparison: if(1 != "1") echo 'here 2'; that will not echo out "here 2" because 1 does equal 1. Link to comment https://forums.phpfreaks.com/topic/136739-solved-quick-question/#findComment-714131 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.