Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- changing the values of xml nodes using PHP
December 2, 2004, 12:28 pm
rate this thread
Is it possible to use PHP to change the values of XML nodes in an XML
file witout having to extract all the node values, change the variable
I want, use PHP to generate the node structure and then save it as an
new XML file?
For example, say I have the following XML structure in an XML file:
Re: changing the values of xml nodes using PHP
i tried the above and got an error. after reading up on regular
expressions i fixed it with the following:
$xml = preg_replace('(<width>.*</width>)', "<width>$width</width>",
i havent included the parts such as '.*?', '/i' as well as a few
slashes. are these required?