note 118356 added to function.filter-var

From: Date: Sun, 22 Nov 2015 06:34:04 +0000
Subject: note 118356 added to function.filter-var
Groups: php.notes 
Request: Send a blank email to php-notes+get-204203@lists.php.net to get a copy of this message
Some boolean conversions: <?php var_dump(filter_var('oops', FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // NULL var_dump(filter_var('false', FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // bool(false) var_dump(filter_var('true', FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // bool(true) var_dump(filter_var(0, FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // bool(false) var_dump(filter_var(1, FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // bool(true) var_dump(filter_var('TRUE', FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // bool(true) var_dump(filter_var('', FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // bool(false) var_dump(filter_var('FALSE', FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE))); // bool(false) ---- Server IP: 72.52.91.14 Probable Submitter: 114.44.177.160 ---- Manual Page -- http://php.net/manual/en/function.filter-var.php Edit -- https://master.php.net/note/edit/118356 Del: integrated -- https://master.php.net/note/delete/118356/integrated Del: useless -- https://master.php.net/note/delete/118356/useless Del: bad code -- https://master.php.net/note/delete/118356/bad+code Del: spam -- https://master.php.net/note/delete/118356/spam Del: non-english -- https://master.php.net/note/delete/118356/non-english Del: in docs -- https://master.php.net/note/delete/118356/in+docs Del: other reasons-- https://master.php.net/note/delete/118356 Reject -- https://master.php.net/note/reject/118356 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204203) next »