PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have created the a script to view the usernames of people currently on my site. I want the names separated by a comma except the last one. The code below is what im using to display names, it displays names ok but I'm not sure how to get it to put a full stop after last name.
What happens in that script is that each $row['username'] value is stored in an array. implode() is then used to add each value of the $users_online array to a string separating it from the previous value by a comma and a space.
Is that simple? I'm not entirely convinced so if it's a bit confusing say so and I'll try again .