public function filterArray($input,$allowed)
	{
		foreach(array_keys($input) as $key )
		{
			if ( !in_array($key,$allowed) )
			{
				unset($input[$key]);
			}
		}
		return $input;
	}
public function filterArray($input,$allowed)
	{
		foreach(array_keys($input) as $key )
		{
			if ( !in_array($key,$allowed) )
			{
				unset($input[$key]);
			}
		}
		return $input;
	}
public function filterArray ( $ input , $ allowed ) { foreach ( array_keys ( $ input ) as $ key ) { if ( ! in_array ( $ key , $ allowed ) ) { unset ( $ input [ $ key ] ) ; } } return $ input ; }
function to filter out arrays, for the whitelisting purposes
useful to pass entire superglobal to the INSERT or UPDATE query
OUGHT to be used for this purpose,
as there could be fields to which user should have no access to.

Example:
$allowed = array('title','url','body','rating','term','type');
$data    = $db->filterArray($_POST,$allowed);
$sql     = "INSERT INTO ?n SET ?u";
$db->query($sql,$table,$data);

@param  array $input   - source array
@param  array $allowed - an array with allowed field names
@return array filtered out source array
function to filter out arrays for the whitelisting purposes useful to pass entire superglobal to the INSERT or UPDATE query OUGHT to be used for this purpose as there could be fields to which user should have no access to .