Mecha CMS

Helper functions.

any

Check if array contains at least one of the specified item.

2.2.0

any(iterable $data, $fn = null);

Example:

// Return `true` if `$data` contains `foo`
if (any($data, 'foo')) { … }
// Return `true` if `$data` contains `0` or `1`
if (any($data, function($v, $k) {
    return 0 === $v || 1 === $v;
})) { … }