Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How to update XML file node value with PHP?
Say I have
<person>
<name>Andrew Marsden</name>
</person>
I want to basically take form input process it with PHP and update the XML file.
<person>
<name>Andrew Cornal</name>
</person>
Say like that as an example. I just need to know how to alter an XML value with PHP. Processing forms I'm OK with its more the XML part of things.
Thanks for any help.
1 Answer
- NikLv 73 years ago
For anyone who wants to know and comes across this question below is the answer I finally got it.
$fname = $_POST['form_input_name'];
$xml = simplexml_load_file('filenamehere.xml');
$xml->person->name = $fname;
$xml->asXML("samefilenamehere.xml");