Last Tube Times
Organic ConditionerOrganic MoisturizerOrganic Grade B Maple SyrupOrganic Maple Syrup

Beware of the & (ampersand) character when parsing XML using PHP’s SimpleXML

If you are getting errors like “parser error : EntityRef: expecting ‘;’” when trying to parse some XML using SimpleXML, it could be because your XML file or string contains an & character. Do the following to remedy the situation:

$correct_xml = str_replace('&','&',$problem_xml);
Bookmark and Share

Tags: , , , , , ,

Leave a Reply