要在Joomla 2.5.15中获取用户组ID,我按照
Joomla Documentation here中的文档进行操作
我的代码如下所示:
$user = JFactory::getUser(); echo "<p>Your group id is {$user->gid}.</p>";
试试这个:
原文链接:https://www.f2er.com/php/134634.html$user = JFactory::getUser(); $groups = $user->get('groups'); foreach ($groups as $group) { echo '<p>Group = ' . $group . '</p>'; }