How can I edit the value's in a xml file using simpleXML ?
I know how to create the file, but not how to edit the value in an existing file ?
Sure you can edit with SimpleXML:
$input = <<<END <?xml version='1.0' standalone='yes'?> <documents> <document> <name>spec.doc</name> </document> </documents> END; $xml = new SimpleXMLElement($input); $xml->document[0]->name = 'spec.pdf'; $output = $xml->asXML();
Take a look at the examples.
2.1m questions
2.1m answers
60 comments
57.0k users