I have a list of teamleads in an array and their corresponding team members in another array.
I need to group them in an array such that under each teamleads the correspondi
Follow the conventions of CakePHP and you won't have this problem.
If you query TeamLead->find() and TeamLead hasAndBelongsToMany or hasMany TeamMember the returned array structure will contain everything you need and in a fashion you can use with the FormHelper methods in the views.