954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

add a new item to XML file using PHP

this is my xml file its using in flash image viewer

<?xml version="1.0" encoding="UTF-8"?>

what i want is add new image tag using php form

ruwanaru
Junior Poster in Training
67 posts since Mar 2009
Reputation Points: 10
Solved Threads: 1
 

Try following these steps:

1. Read the XML file content into a PHP array.
There are many ways of doing this. I'd recommend the use of a couple of simple functions for converting between XML data and PHP arrays. (Google "php array to xml")

2. Add the new image to the array.
Then sort the array (if order is of any concern).

3. Convert the array back into XML and write that out to the XML file.
(Use the function/s from #1)

Hope that helps.

-Dave

metaface
Newbie Poster
11 posts since Jan 2006
Reputation Points: 10
Solved Threads: 1
 

ok thanx ill try

ruwanaru
Junior Poster in Training
67 posts since Mar 2009
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You