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.
いくつかの再帰関数の後、私は配列を持っています:
最初の反復: 配列([category_id] => 3 [title] => Aqua [parent] => 0))
2番目: 配列([category_id] => 5 [title] => Sea aqua [parent] => 3)配列([category_id] => 3 [title] => Aqua [parent] => 0))
等々...
[親]=>0の配列を1つだけ表示するにはどうすればよいですか?
あなたはおそらくこのようなことをしたいと思うでしょう:
foreach ($arrays as $arr){ if ($arr['parent'] == 0){ echo $arr['category_id'] . "\n"; } }