Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grabbing all of the files in a directory 1

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
I've actually got no experience at PHP, (I've always used ASP) but the server I'm on only uses PHP so I'm really in dire need of some help!

I need to grab all of the names of files in a certain directory, and package the results into an XML document. I have no idea how to go about doing this. It's worth a star!


The help, as always, is very much appreciated!
-Matthew

Cyprus
 
The Grabbing should be fairly simple:

Either use GLOB, or Opendir and readdir Functions to get the directory contents.


Then using fopen and fwrite just write the produced output into a file. Adding any and all XML info you might need.








----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Is there anywhere I can find the code for this? Because like I said, I know as much as <% and %> and that's about it!

Cyprus
 
I linked you to the php manual pages for each function. In there there is plenty of example code for how to use the functions.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
lol, I realized that after I sent the message. (I've only done ASP... Must've just come naturally)

I appreciate the help vacunita!

Cyprus
 
Your welcome, if you need help on specifics when trying to implement it, then by all means ask away.






----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top