This code is to check if user belong to one group:
//get logged in user $user = JFactory::getUser(); $group_id = 20; //This is the group we are checking. ->usergroup **Sales** Group if(in_array($group_id, $user->getAuthorisedGroups())) { //The user is in this group }else{ echo 'No output'; }
BUT I want to check if user belongs to 2 groups.
$group_id = 20;//This is the group we are checking. ->usergroup **Sales** Group and $group_id = 21;//This is the group we are checking. ->usergroup **Design** Group
How do I do that?
Thanks in advance!