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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to dump a flat file into anarray

Status
Not open for further replies.

pseudopercept

Programmer
Joined
Jun 19, 2003
Messages
1
Location
US
Here's my problem... I'm trying to build a directory index, no problem, i got that. What I don't have is a way to have the index look at all of the PHP & HTML files in the directory, dump the contents into an array, so tat I can display a certain array index next to the file names of the directory index.

Any Ideas?
 
Read the directory. Insert the filenames into your array using something like:
Code:
$myarray[] = $thecurrent filename
which will append the new value to the end of the array.

Then loop through the array, outputting the array index and the value.


Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top