I'm guessing the $row consists of a Printer name, followed by all users that get that printer. I would suggest using the AScan function to see if the user is in that row, instead of looping through each element needlessly.