PHP: Is it wise to call a method&nested loop in a foreach loop?

GliblyCewly

New Member
Hi I have a method that returns an array of support tickets. Each support ticket can have many notes so I have a method that returns an array of tickets notes with that ticket id. I want to display the notes alongside the ticket which would mean nesting the get notes inside the foreach loop. \[code\]foreach($tickets as $ticket){ //display ticket info //now get ticket notes using method getNotes() foreach($ticketnote as $note){ //display note }} \[/code\]Do nested loops like this have performance implications? Is this good practice?Thanks, Jonesy
 
Back
Top