foreach($taxonomy_tree as $item){ $taxonomy_item_family = (json_encode($item)); $string = '"id":"1"'; if (str_contains($taxonomy_item_family, $string)) { dd($item); } }
Pro tip: use ```triple backticks around text``` to write in code fences