Compare value _and_ type


/ Published in: PHP
Save to your folder(s)

Since PHP is typeless odd things can happen when a variable is not the type you expected. PHP treats 0, null, '0', false, and '' as false. Sometimes you really want to know if the value is false. The solution is simple, use the triple equal (===) operator.

URL: http://www.mthorn.net

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.