I have the following folder structure:
food fruits - apples - red apple - green apple - yellow apple - bananas - pineapples - grapefruit - red grape - white grape - rose grape vegetables - carrots - potatoes - beets - tomatoes
What I need to get is only the last child folder of each particular instance, to get, as an example:
red apple, green apple, yellow apple, bananas, pineapples, red grape, white grape, rose grape, carrots, potatoes, beets, tomatoes
I’ve tried nesting foreach cycles and I’ve made it work for three levels, but sometimes the structure grows deeper.
Thanks in advance!
Edit: I just realized tomatoes are, ‘technically’, fruits. Haha.