tags:

views:

105

answers:

3

After initiating a new SimpleXml object:

$xml = new SimpleXML($xmlStr);

PHP errors out:

Fatal error: Class 'SimpleXML' not found

PHP info reads:

  • Simplexml support enabled
  • Revision $Revision: 1.151.2.22.2.35.2.32 $
  • Schema support enabled

What could possibly be going wrong?

+2  A: 

try SimpleXMLElement

nickf
Thanks, another post: http://stackoverflow.com/questions/1417795/replacing-image-src-in-html-tags threw me off as it uses SimpleXml, not SimpleXmlElement.
Danten
+2  A: 

It's SimpleXMLElement.

zneak
+1  A: 

To parse XML, use:

simplexml_load_string($string);

Or:

simplexml_load_file($filename);

These will each return SimpleXMLElement objects, as noted by others.

Joseph Mastey
the constructor for SimpleXMLElement takes a data string too.
nickf