change a value xml in php but false with a node name id-7 [closed]

TainaKutze28

New Member
\[quote\] Possible Duplicate:
SimpleXML Reading node with a hyphenated name \[/quote\]I want to change a xml, but fails with this code. I think mistake with name of variable (ID-1) in php.chang.php\[code\]<?php include 'example.php'; $xml = new SimpleXMLElement($xmlstr); $xml->ID-1 = '8';$xml->name = 'Big Cliff'; $xml->asXML('test2.xml');echo $xml->asXML(); ?>\[/code\]example.php\[code\]<?php$xmlstr = <<<XML<?xml version="1.0" encoding="utf-8"?><film> <ID-1>29</ID-1> <name>adf</name> </film>XML;?>\[/code\]
 
Back
Top