Thread: php help
View Single Post
  #1  
Old 07-10-2008, 02:32 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default php help

im trying to put in my website a who all online thingy.

i can list all the players online with a telnet connection but it outputs more info then i need

so i want to strip our everything i don't need and only keep what i do and i have always had problems with striping so i figured i would ask for help.

i am using this.

PHP Code:
    fConnect($fp,$Server,$Port,$user,$pass);

               
fputs ($fp"who\r"); 
        
usleep(125000);

            
                   while (!
feof($fp))
            {
                   
$ret fgets($fp);
                if (
ereg("zone"$ret)) {
                echo 
"$ret \n <br>";
                }
                       if  (
ereg("online"$ret)){
                           echo 
"$ret \n";
                
fclose($fp);
                break;
                       }
            } 
and it outputs something like this

Code:
[59 Master] Yuari (Iksar) zone: sebilis AccID: 298 AccName: Flora LSID: 110561 Status: 0 

1 player online
i want to strip out everything and make a table that says

level name race class zone
and then strips everything and places relevant info under the right catagory..

can someone help me with this?

Last edited by Cripp; 07-12-2008 at 04:13 AM.. Reason: changed to pvp tag instead of code! :) more pretty.
Reply With Quote