- array_column: documentation ( source)
- array_search: documentation ( source)
- print_r: documentation ( source)
<?php
$objs = [ ['value'=>2, 'key'=>'a'], ['value'=>3, 'key'=>'b'] ];
print_r($objs);
$keys = array_column($objs, 'key');
$index = array_search('a', $keys);
if ($index !== false) {
$objs[$index]['value'] = 5;
}
print_r($objs);