core-bundle/src/Resources/contao/library/Contao/User.php
public function isMemberOf($id)
	{
		// ID not numeric
		if (!is_numeric($id))
		{
			return false;
		}

		$groups = StringUtil::deserialize($this->groups);

		// No groups assigned
		if (empty($groups) || !\is_array($groups))
		{
			return false;
		}

		// Group ID found
		if (\in_array($id, $groups))
		{
			return true;
		}

		return false;
	}
public function isMemberOf($id)
	{
		// ID not numeric
		if (!is_numeric($id))
		{
			return false;
		}

		$groups = StringUtil::deserialize($this->groups);

		// No groups assigned
		if (empty($groups) || !\is_array($groups))
		{
			return false;
		}

		// Group ID found
		if (\in_array($id, $groups))
		{
			return true;
		}

		return false;
	}
Return true if the user is member of a particular group

@param integer $id The group ID

@return boolean True if the user is a member of the group