Jump to content
php.lv forumi

sadalīt grupās


goma smile

Recommended Posts

Agrāk bija kaut kā tā ....

 

$groups=array(
"101"=>'<font>Game master level 1</font>',
"102"=>'<font>Game master level 2</font>',
"103"=>'<font>Game master level 3</font>',
"201"=>'<font>Moderātors</font>',
"202"=>'<font>Administrātors</font>',
"500"=>'<font>Boss</font>',
);

foreach ($users as $user){
if($group != $user->u_level) echo '<div class="h1" >',$groups[(int)$user->u_level],'</div>';
echo $user->u_login;
$group = $user->u_level;
}

 

un viņš pie katras grupas izvadija atbilstošo lietotāju...

bet tagad vaig, ja piemēram u_level = 102.202 ...

 

piemēram ja lietotājs 2 grupās, kaut kā ar explode, bet man nesanāk ...

Edited by goma smile
Link to comment
Share on other sites

Nejiet kaut šis

 

$groups=array(
"101"=>'<font>Game master level 1</font>',
"102"=>'<font>Game master level 2</font>',
"103"=>'<font>Game master level 3</font>',
"201"=>'<font>Moderātors</font>',
"202"=>'<font>Administrātors</font>',
"500"=>'<font>Boss</font>',
);

echo $groups[explode(".", $user->level)];

 

array() nejiet kopā ar explode ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...