public function whiteList($input,$allowed,$default=FALSE)
	{
		$found = array_search($input,$allowed);
		return ($found === FALSE) ? $default : $allowed[$found];
	}
public function whiteList($input,$allowed,$default=FALSE)
	{
		$found = array_search($input,$allowed);
		return ($found === FALSE) ? $default : $allowed[$found];
	}
public function whiteList ( $ input , $ allowed , $ default = FALSE ) { $ found = array_search ( $ input , $ allowed ) ; return ( $ found === FALSE ) ? $ default : $ allowed [ $ found ] ; }
function to implement whitelisting feature
sometimes we can't allow a non-validated user-supplied data to the query even through placeholder
especially if it comes down to SQL OPERATORS

Example:

$order = $db->whiteList($_GET['order'], array('name','price'));
$dir   = $db->whiteList($_GET['dir'],   array('ASC','DESC'));
if (!$order || !dir) {
throw new http404(); //non-expected values should cause 404 or similar response
}
$sql  = "SELECT * FROM table ORDER BY ?p ?p LIMIT ?i,?i"
$data = $db->getArr($sql, $order, $dir, $start, $per_page);

@param string $iinput   - field name to test
@param  array  $allowed - an array with allowed variants
@param  string $default - optional variable to set if no match found. Default to false.
@return string|FALSE    - either sanitized value or FALSE
function to implement whitelisting feature sometimes we can t allow a non - validated user - supplied data to the query even through placeholder especially if it comes down to SQL OPERATORS