Mecha CMS

Helper functions.

find

Return value of the first array item that pass the function test.

2.2.0

find(iterable $data, callable $fn);

Example:

$href = find($data, function($v, $k) {
    return isset($v['rel']) && 'alternate' === $v['rel'];
})['href'] ?? '#';