Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Parsing XML with PHP question
10-11-2009, 07:16 AM #1
- Join Date
- Oct 2009
- Thanked 0 Times in 0 Posts
Parsing XML with PHP question
I'm really new to parsing XML so forgive me if my terminology is a bit off.
I have a script that was written by some else and I have been working on updating it's abilities to display the outputs. Basically what this script does is parses an xml page, gathers the info and outputs it in a .png image.
I have run into a problem when parsing a line from the xml page that contains line breaks and a link with some other info.
The line in the xml I want to show looks like this:
<stateMessage> In-Game<br />Day of Defeat: Source - <a href="steam://connect/18.104.22.168:27015">Join</a> </stateMessage>
imagettftext($image, $state['fontsize'], 0, $state['x'], $state['y'], $colors['state'], $fontpath.$state['font'], "". strip_tags($steam['msg']));
What ends up happening is the output looks like this with everything all smashed together:
In-GameDay of Defeat: Source - Join
What I would like to do is have a space in between the In-Game and the Name of the game and remove the - Join
I know this can be done because I have seen similar php code do it but I can not figure out what I need to change or add to make mine work this way.
Not sure if this is enough info to even get an answer but any help would be greatly appreciated.