I am trying to parse an XML file and there are some values that contain a : as you can see below.
$rss_xml = SimpleXML_Load_String($rss_data);
foreach ($rss_xml->channel->item as $item) {
echo $item->title;
echo "<br />";
echo $item->link;
echo "<br />";
echo $item->description;
echo "<br />";
echo $item->g:price;
echo "<br />";
echo $item->g:image_link;
echo "<hr />";
}
For some reason because of this : I get the error.
HP Parse error: syntax error, unexpected ':', expecting ',' or ';' in /home/blah/blah/blah/index.php
I have tried escaping it with a \ and also quoting the last element in the echo but it still will not have it.
Any suggestions.
Thanks