public static function filterKeys($unfiltered, $whitelist)
	{
		$filtered = array_filter($unfiltered, function($key) use ($whitelist) {
			return in_array($key, $whitelist);
		}, ARRAY_FILTER_USE_KEY);

		return $filtered;
	}
public static function filterKeys($unfiltered, $whitelist)
	{
		$filtered = array_filter($unfiltered, function($key) use ($whitelist) {
			return in_array($key, $whitelist);
		}, ARRAY_FILTER_USE_KEY);

		return $filtered;
	}
public static function filterKeys ( $ unfiltered , $ whitelist ) { $ filtered = array_filter ( $ unfiltered , function ( $ key ) use ( $ whitelist ) { return in_array ( $ key , $ whitelist ) ; } , ARRAY_FILTER_USE_KEY ) ; return $ filtered ; }
Filters keys from given array based on whitelist

@param    array   $unfiltered   Array to filter
@param    array   $whitelist    List of allowed keys
@return   array
Filters keys from given array based on whitelist