问题描述:

db=array();

for($i=1;$i<=n;$i++){

$db[]=array(

'spec'=>$spec,

'res'=>$res

);

}

Array, which I need to run a function on to return a result where if

$res=1 i have to print $spec or else not

网友答案:
foreach($db as $item) 
{
if($item['res']==1) echo $item['spec'];
}
相关阅读:
Top