note 106307 added to filter.filters.validate

From: Date: Wed, 26 Oct 2011 19:10:31 +0000
Subject: note 106307 added to filter.filters.validate
Groups: php.notes 
Request: Send a blank email to php-notes+get-184147@lists.php.net to get a copy of this message
It's important to note that in PHP, false==null is true. This means when you are using the FILTER_VALIDATE_BOOLEAN, you must use '===' and '!==' to check to see if something is/isn't null. $false = filter_var('0', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); if ($false==null) { //will execute } if ($false===null) { //will not execute } ---- Server IP: 69.147.83.197 Probable Submitter: 128.187.97.5 ---- Manual Page -- http://www.php.net/manual/en/filter.filters.validate.php Edit -- https://master.php.net/note/edit/106307 Del: integrated -- https://master.php.net/note/delete/106307/integrated Del: useless -- https://master.php.net/note/delete/106307/useless Del: bad code -- https://master.php.net/note/delete/106307/bad+code Del: spam -- https://master.php.net/note/delete/106307/spam Del: non-english -- https://master.php.net/note/delete/106307/non-english Del: in docs -- https://master.php.net/note/delete/106307/in+docs Del: other reasons-- https://master.php.net/note/delete/106307 Reject -- https://master.php.net/note/reject/106307 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184147) next »