<?php
function findByName(&$list, &$name, &$out)
{
foreach($list as $row)
{
if (!is_array($row)) {continue;}
if (isset($row['id']) && isset($row['name']) && $row['name']==$name ) {$out[] = $row['id'];} // pripadne si tam dej jinou
else {findByName($row, $name, $out);}
}
}
$list = array(
'status' => "ok"
,'data' => Array
(
'fishes' => Array
(
'0' => Array
(
'name' => "carp"
,'id' => 1
,'weight' => 35
)
,'1' => Array
(
'name' => "silur"
,'id' => 2
,'weight' => 98
)
,'3' => Array
(
'name' => "carp"
,'id' => 11
,'weight' => 35
))));
$findName = "carp";
$founded = array();
findByName($list, $findName, $founded);
var_dump($founded);
?>
Dostal jsem se k tomu, predelat to. Udelal jsem to zrovna na tu vyhledavaci funkci