I'm very new to Joomla and PHP, however I'm attempting to echo the logged in users assigned groups (group id 58-62, 72). A user can only be in one of those groups at any point and time. Below is the code I'm using. It doesn't display any errors, and echos the first line, but no echo based off groupid. Also, the print_r doesn't return any data.
Any guidance on what I'm certain is a silly mistake on my part would be appreciated.
$groups = $user->get('groups');
print_r($groups);
if($groups) {
echo "Echo user Group Name : ";
if (isset($groups[62])) echo " - Group 62 <Br/>";
if (isset($groups[61])) echo " - Group 61 text <Br/>";
if (isset($groups[60])) echo " - Group 60 text <Br/>";
}else{
echo 'Not logged in<Br/>';
}
}