View Single Post
Old 06-01-2014, 02:56 PM  
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by blackmonsters View Post
Like I said, the correct way to do it is !== false
Just be careful with this .. a lot of people here have a "sort of" understanding of PHP. If you use the exact match syntax with other variable types, PHP acts in unexpected ways. For example, even though PHP has a very forgiving manner of variable typing (string versus float, etc) when compared to C or Java, it acts strictly when using ===.

$variable = '5';
if ($variable === 5) will react differently than if ($variable == 5) or if ($variable === '5')

(false, true, true)
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote