help striping "_"'s

i am working on a script that displays the status of a game server and the database out puts the players like this

Lit._The Fist_GRIM-TL-BB11_GRIM-KP1-PD_CHARLy-bR0WN_GRIM-S-M0NK3Y_GRIM-KP1-Dakilr_GRIM-M-LockOut_landsurveyor

each one of the "_"s are where a new name begins and ends they seperate them.

i want to know if it is possible to remove those and replace them with a <BR>
any help is apreciated.
if you want to view the script go to and look at the right side

$text = str_replace(’_’, ‘
’, $text);


also it outputs a corrisponding string that is like 1_2_1_1_2_2_2
1 is team 1 2 is team 2 it corrisponds to the name is there any way to make it so that it changes the color of the players name depending on team like i want 2 to be red and 1 to be blue.
thanks for the help

Take a look at the explode() or split() function in the manual. Ohw, and read up on arrays, you’ll find them quite handy, both for what you want to achieve right now, and in any future scripts.

ty i know a bit about arrays just dont understand them much i will read up on all those things :D

i read up on explode it helped alot!

Glad to be of service :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service