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
Post a Comment