Is there any way to count users in my chatroom and display whos chatting using javascript or ajax? code in php below has issues, but this is what it should do.
Code:
<?php
$chatnames = file('http://client11.addonchat.com/scwho.pl?id=292747&plain=1');
$indx = count($chatnames);
$indxcom = $indx - 1;
if ($indx == 0) {
echo "<b>No one is in the chat room at the moment</b>";
}
else{
echo "<b>People Chatting:</b> ";
for($i = 0; $i < $indx; $i++) {
$name = explode(' ', $chatnames[$i], 2);
echo " $name[0]";
if ($i < $indxcom) {
echo ", ";
}
}
}
?>
Comment