|
Size: | 9290 |
Storage flags: | no_autoload,compress/gzip (31%) |
This filter will return null if the value being filtered is not present the filter’s allowed list of values. If the value is present, it will return that value.
For the opposite functionality see the Blacklist filter.
The following options are supported for Zend\Filter\Whitelist:
This is a basic example:
1 2 3 4 5 | $whitelist = new \Zend\Filter\Whitelist(array(
'list' => array('allowed-1', 'allowed-2')
));
echo $whitelist->filter('allowed-2'); // => 'allowed-2'
echo $whitelist->filter('not-allowed'); // => null
|
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.