Ciao.
Codice PHP:
function seek($array, $key, $needle) {
foreach($array as $a){
if(key_exists($key, $a) && $a[$key]==$needle)
return $a;
}
return null;
}
$array= array(array('id'=>'1','title'=>'uno'),array('id'=>'2','title'=>'due'),array('id'=>'3','title'=>'tre'));
print_r(seek($array,'id','1'));
echo "
";
print_r(seek($array,'title','due'));
![]()