|
Posted by johnmark on 07/28/06 04:41
I am trying to run examples in the php.net but I am getting the error
Fatal error: Call to undefined method SimpleXMLElement::addChild()
The example is as follows
$xml = new SimpleXMLElement($xmlstr);
$character = $xml->movie[0]->characters->addChild('character');
$character->addChild('name', 'Mr. Parser');
$character->addChild('actor', 'John Doe');
$rating = $xml->movie[0]->addChild('rating', 'PG');
$rating->addAttribute('type', 'mpaa');
echo $xml->asXML();
Does anyone konw whats going on here?
Navigation:
[Reply to this message]
|