Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在一些递归函数之后,我有一个数组:
第一次迭代: Array ( [category_id] => 3 [title] => Aqua [parent] => 0 ) )
第二: Array ([category_id] => 5 [title] => Sea aqua [parent] => 3) Array ([category_id] => 3 [title] => Aqua [parent] => 0))
等等...
如何仅显示 [parent] => 0 的一个数组?
你可能想做这样的事情:
foreach ($arrays as $arr){ if ($arr['parent'] == 0){ echo $arr['category_id'] . "\n"; } }