Get ID's of users in group in array

Permalink
How do i get the ID's of users in a user group?

I can get an array of "UserInfo Objects" by doing this:

$group = \Concrete\Core\User\Group\Group::getByName('GROUPNAME');
$usersInGroup = $group->getGroupMembers();


but how can I get just the IDs?
Can't seem to work it out.

Any help appreciated.

 
eudemonics replied on at Permalink Reply
Worked it out, probably not the best way to do it but the documentation is non existant
$usersIDArray = array();
$i = 0;
foreach ($usersInGroup as $userInGroup ) {
     $usersIDArray [$i] = $userInGroup->getUserID();
     $i++;
}