Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

getgroupname

Get the name of the access lever or user group along with the description if $return_desc is set to true.

getgroupname

Quote

getgroupname ( int $group_id [, bol $return_desc ] )


Parameters
group_id
ID of the group or access level you want the name to

return_desc
Set this to true if you want the description to a group returned as well as the name (default is false).

Return Values
This function will return the name of the given $group_id. If $return_desc is set to true (default is false) it will return the description of the group if there is one.

Examples
For access levels
Code
<?php
echo getgroupname(0, true);
echo getgroupname(101, false);
echo getgroupname(102);
echo getgroupname(103);
?>


Output

Quote

Public
Member
Administrator
Super Administrator

We will get a return of the names in the different Access levels (0, 101, 102, 103).
Notice that the return_desc will not return any description as the Access levels do not contain any descriptions.

For user groups
Code
<?php
$group_id = 1; // The id for the group
 echo getgroupname($group_id, true);
?>


Output

Quote

Group Name - Group Description

The function returned the name of the given $group_id, in this example 1 and the description to the group.

Notes
This function will not return any description for Access Levels, only for User Groups.
If you only want the names of the user levels we recommend you to use the getuserlevel() function.


See also …


References