php error loading an rss feed with “&” in the data

lempreur

New Member
My task is loading an xml rss feed with php. I solved it smoothly so far, but I randomly encountered a problem the other day: If the news contains the ampersand character (&) in the .xml file, I will get a php error. I understand the error and all, but i couldnt find a proper solution so far.\[code\]$URL = 'http://somesite.com/file.xml';$DOM = new DomDocument();$DOM->load($URL);Warning: DOMDocument::load(): EntityRef: expecting ';' in file\[/code\]I tried different things like:\[code\]$DOM->recover = TRUE;$DOM->load($URL);\[/code\]The to be loaded .xml files are in UTF-8.Thank in advance.
 
Back
Top