PHP-Fusion Development


Check if user is assigned to the specified user group and has the required user level.

Versions: 9

checkusergroup( int $group, int $user_level, string $user_groups ) : bool


$group (int) (Required) The group number you want to check for the user.

$user_level (int) (Required) User level.

$user_groups (string) (Required) Assigned groups to the user.

Return Values

(bool) True if the user has access.


$page_access = USER_LEVEL_MEMBER;
$userdata = fusion_get_userdata();
if (checkusergroup($page_access, $userdata['user_level'], $userdata['user_groups'])) {
echo 'You have access to this section.';