in reply to nested loops

See Variable number of foreach loops