I'm guessing you didn't get this sorted.
Anyways depending on the number of members there could be a few ways to do it,
Mysql table, ( when a user logs in they are added to a table) you can then query this table and do what you need. ( if you add there session id you may be able to log them out? haven't tried this but will do sounds fun)
Array, ( for a few members only,) this is fairly easy to do, but will take memory and time, to search and sort, perhaps a linked list would be better here.
Anyways hope that helps