getKeyValues function getKeyValues($arr, $key){ $ret = []; foreach ($arr as $row) { if (is_array($row) array_key_exists($key, $row)) { $ret[] = $row[$key]; } elseif ($row instanceof \ArrayObject) { $row-offsetExists($key) $ret[] = $row-offs
function getKeyValues($arr, $key) { $ret = []; foreach ($arr as $row) { if (is_array($row) && array_key_exists($key, $row)) { $ret[] = $row[$key]; } elseif ($row instanceof \ArrayObject) { $row->offsetExists($key) && $ret[] = $row->offsetGet($key); } } return $ret; }