goma smile Posted January 7, 2011 Report Share Posted January 7, 2011 (edited) 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 January 7, 2011 by goma smile Quote Link to comment Share on other sites More sharing options...
goma smile Posted January 8, 2011 Author Report Share Posted January 8, 2011 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 ? Quote Link to comment Share on other sites More sharing options...
Rincewind Posted January 8, 2011 Report Share Posted January 8, 2011 array() nejiet kopā ar explode ? explode() saliek rindu arājā, pamēģini implode() Quote Link to comment Share on other sites More sharing options...
goma smile Posted January 8, 2011 Author Report Share Posted January 8, 2011 explode() saliek rindu arājā, pamēģini implode() Biju arī šito meiģinājis, bez panākumiem Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted January 8, 2011 Report Share Posted January 8, 2011 Tu vispār saproti ko viņi abi dara un kā vajag padot masīva indeksus? http://uk3.php.net/explode http://uk2.php.net/manual/en/language.types.array.php Izskati šos divus linkus, mēģini izprast un uzraksti kodu. Ja nestrādā kā vajag, tad parādi ko esi uzrakstījis un gan jau kāds centīsies palīdzēt. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.