note 113102 added to function.filter-input

From: Date: Thu, 29 Aug 2013 14:17:21 +0000
Subject: note 113102 added to function.filter-input
Groups: php.notes 
Request: Send a blank email to php-notes+get-196122@lists.php.net to get a copy of this message
The beauty of using this instead of directly using filter_var( $_GET['search'] ) is that you don't need to check if( isset( $_GET['search'] ) ) as if you pass that to filter_var and the key is not set then it will result in a warning. This function simplifies this and will return the relevant result to you (as per your options set) if the key has not been set in the user input. If the type of filter you are using also supports a 'default' argument then this function will also stuff your missing input key with that value, again saving your efforts ---- Server IP: 69.147.83.199 Probable Submitter: 115.114.59.182 ---- Manual Page -- http://php.net/manual/en/function.filter-input.php Edit -- https://master.php.net/note/edit/113102 Del: integrated -- https://master.php.net/note/delete/113102/integrated Del: useless -- https://master.php.net/note/delete/113102/useless Del: bad code -- https://master.php.net/note/delete/113102/bad+code Del: spam -- https://master.php.net/note/delete/113102/spam Del: non-english -- https://master.php.net/note/delete/113102/non-english Del: in docs -- https://master.php.net/note/delete/113102/in+docs Del: other reasons-- https://master.php.net/note/delete/113102 Reject -- https://master.php.net/note/reject/113102 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196122) next »