Read and print XML with only small changes using PHP -


i've been looking simple way print xml url, came, few changes. have feed:

<products> <product> <name>product example</name> <image>http://example.com</image> </product> </products> 

i want take , print out this:

<products> <product> <name>product example</name> <image>http://example.com?utm_campaign=changes</image> </product> </products> 

is possible?

thanks!

you can load xml file using simplexml_load_file()

doc : http://php.net/manual/fr/function.simplexml-load-file.php

it permits create object xml loaded. modify want on, use dom_import_simplexml() transform domelement.

doc : http://www.php.net/manual/en/function.dom-import-simplexml.php

using domelement::savexml() returning xml result.

doc : http://php.net/manual/fr/domdocument.savexml.php

don't know if it's easiest way, work.

thanks.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -