Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

php xml

Links for php scripts

Moderators: macek, egami, gesf

php xml

Postby kristtee » Sun Jun 12, 2011 7:30 pm

Hello
I am no good in scripting, yet i am trying. I have folder full of images. I want to write a phpscriipt to read the folder and generate an xml file as
<root>
<file>
<name> [this should be image file name] </name>
<loc> [image path with extension]</loc>
</file>
<file>
<name> [this should be image file name] </name>
<loc> [image path with extension]</loc>
</file>
</root>

is it possible to do it?
hope it can be done. please help me.
thanks
krish
kristtee
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sun Jun 12, 2011 7:08 pm

Re: php xml

Postby johnj » Sun Jun 12, 2011 11:12 pm

use opendir() and readdir() to get all the files in a directory. Once you have the filenames and path, go ahead and generate an xml. Instead of opendir() and readdir(), you can also try scandir(). Please read more about this on php.net.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron