Hello all,

I'm a newbie at XML and I've been struggling to get information on escaping special characters in XML sent by third party.

Below is the complete XML and PHP script.
XML game element containt special character "&".
I was hoping if someone could explain what can be done to detect and escape the special characters in the XML.

Many thanks,
Andrew

XML:

<element1>
<day id="1">
<game id="1" name="South Africa & Mexico" date="11/06/2010" time="17:30">
This is a bit of description about the the South Africa vs Mexico Game.
</game>
</day>
</element1>

PHP:

<?PHP
$xml = simplexml_load_file("xml.xml");

$game = $xml->xpath("//game");

echo $game[0]['name'];

?>