It all depends of what you are tring to achive.
from the code you have posted, one would assume (probably wrongly) that you are tring to list the uses, but not users in some groups.
What you could do is process your data at your echo statement.
for example:
get data from database
if group = #
do something
else if
etc.
this however, would depend on how many groups you have and might be a nightmare to sort in the future.
we'll help you all we can
hope this helps...
🙂