我有兩個下面如何關聯給定的foreach循環?
foreach($result_access as $acc){
$usr_access_id[] = $acc->id;
$usraccess[] = $acc->rules;
}
給出循環>更新的
foreach($somearray as $someid){//Updated
foreach($usraccess as $accessusr){
if(in_array($someid,$usraccess)){
$myid = ??;///Here i want the $usraccess associated $acc->id, how can I get that?
}
}
}
正如你可以看到,我想$myid
得到與$acc->id
應與當前$usraccess
陣列
哪裏是'$ someid'而來? – Ben 2012-07-05 12:36:19
它來自另一個foreach()循環 – 2012-07-05 12:40:12