Page MenuHomePhorge

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$listList of arrays to filter.
scalar$indexThe index.
bool$negateOptionally, pass true to drop arrays which pass the filter instead of keeping them.
Return
arrayList of arrays which pass the filter.