Search multidimensional array

Searches nested array key based on its value. Read more.

php
fork add to bundle source
function multi_search($array, $key, $value) { return array_search($value, array_column($array, $key)); }

usage

load_function('multi_search'); $array = [ 0 => ['age' => 12], 1 => ['age' => 13], 2 => ['age' => 14], ]; echo multi_search($array, 'age', 13); // 1
← how to use this in app?
create log ...inout