String Replace with font color

Discussion in 'PHP' started by mcdeere02, Aug 5, 2009.

Thread Status:
Not open for further replies.
  1. #1
    I am grabbing a game server's name, and displaying it on a page.
    In the game configuration files on windows, you can set your server name with colors

    Example:

    ^1 - RED
    ^2 - GREEN
    ^3 - YELLOW
    ^4 - BLUE
    ^5 - CYAN
    ^6 - PINK
    ^7 - WHITE
    ^8 - DEFAULT MAP COLOR
    ^9 - GREY OR DEFAULT MAP COLOR
    ^0 - BLACK

    So if i set my server name as ^1Server ^4Come Join!
    It would show up as Server Come Join! in the server list.

    Now I have got the server name displaying in a page, and replaced the ^# signs with a blank entry
    $hostname will display the server name, but with the color coded characters, which of course I would not want displaying
    I would instead like to have them display the appropriate color

    How would I go about replacing ^0 with black and so on.
    Thanks
     
    mcdeere02, Aug 5, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why are you duplicating someone else's thread (which has already been answered)?
     
    premiumscripts, Aug 5, 2009 IP
Thread Status:
Not open for further replies.