Northern Flame Posted March 10, 2008 Share Posted March 10, 2008 When I run this script: <?php $xmlstr = <<<XML <?xml version='1.0' standalone='yes'?> <movies> <movie> <title>PHP: Behind the Parser</title> <characters> <character> <name>Ms. Coder</name> <actor>Onlivia Actora</actor> </character> <character> <name>Mr. Coder</name> <actor>El ActÓr</actor> </character> </characters> <plot> So, this language. It's like, a programming language. Or is it a scripting language? All is revealed in this thrilling horror spoof of a documentary. </plot> <great-lines> <line>PHP solves all my web problems</line> </great-lines> <rating type="thumbs">7</rating> <rating type="stars">5</rating> </movie> </movies> XML; $xml = new SimpleXMLElement($xmlstr); echo $xml->movie[0]->plot; // "So this language. It's like..." ?> I get this error: Fatal error: Cannot instantiate non-existent class: simplexmlelement in /path/to/my/website.com/script.php on line 32 (I got this code from http://us3.php.net/manual/en/ref.simplexml.php) Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 10, 2008 Share Posted March 10, 2008 The SimpleXML extension requires PHP 5. do you have PHP 5? Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted March 10, 2008 Author Share Posted March 10, 2008 no i have 4.3.11 is their any other way to do something like this with 4.3.11? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 10, 2008 Share Posted March 10, 2008 if you have xml compiled in, there are a lot of xml functions. i guess i'd start here: http://us.php.net/xml_parser_create Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted March 10, 2008 Author Share Posted March 10, 2008 alright thanks ill have a look at it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.