function ifilter($list, $index, $negate)Arcanist Technical Documentation ()
function ifilter($list, $index, $negate)
Arcanist Technical Documentation ()
Filter a list of arrays by removing the ones with an empty() value for some index. This function works just like mfilter(), except that it operates on a list of arrays instead of a list of objects.
For example, to remove all arrays without value for key 'username', do this:
ifilter($list, 'username');
The optional third parameter allows you to negate the operation and filter out nonempty arrays. To remove all arrays that DO have value for key 'username', do this:
ifilter($list, 'username', true);
Parameters
array | $list | List of arrays to filter. |
scalar | $index | The index. |
bool | $negate | Optionally, pass true to drop arrays which pass the filter instead of keeping them. |
Return
array | List of arrays which pass the filter. |
- Defined
- src/utils/utils.php:568