News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Seperating a list of users with a comma and space

Started by Simplemachines Cowboy, April 15, 2006, 11:57:02 PM

Previous topic - Next topic

Simplemachines Cowboy

Here is a block of code that displays a list of user names in a chat room.

<?php

$users usersinroom($room['id']);
                                        if (
$users) { 
                                          echo 
"<ul class=\"userList\" id=\"room_".$room['id']."\">";
                                          foreach( 
$users as $user ) {
    echo $user['login'] ;
  }


Right now, all the names are running together (User1User2etc).
I can't quite get the code to add a comma and a space between each user name (User1, User2, etc).

Help please!

Thanks in advance,

Cowboy
My SMF forum: The Open Range


Advertisement: