function isAccessibleGroup($group) { $allowedGroups = ['admin', 'editor', 'author', 'subscriber']; return in_array($group, $allowedGroups); } if(isAccessibleGroup('admin')) { echo 'You have access!'; } else { echo 'Access denied.'; }In this example, the function checks whether the user group 'admin' is in the allowed groups array. If it is, the function returns true and displays the message 'You have access!'. Otherwise, the function returns false and displays 'Access denied.'. The isAccessibleGroup function is commonly included in PHP packages or libraries that provide access control and permission management functionalities. One such package is the Laravel Permissions package, which allows you to manage user roles and permissions in your Laravel application. Another package is the AccessControl package, which provides fine-grained access control features for any PHP project.