NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page getting a list of files in a directory thread

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
6 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 04-18-2005, 11:13 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
selfmindead's Avatar
Join Date: Nov 2004
Location: Orange County, California.
Posts: 389
selfmindead is on a distinguished road
 



getting a list of files in a directory


hi guys, i'm wondering if someone knows of a function, or method of getting a list of all the files in a directory... id like to put all the files into one string name like this:

$string = "file1.bmp:file2.bmp:file3.bmp"

so that i can explode it later in the script for use....

if someone can help me with a method like this id be extremely greatful, I'm doing a job for work and I need is as soon as possible

Thanks,
Jeremy
__________________
My del.icio.us
selfmindead is offline  
Old 04-18-2005, 11:58 AM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



You could use glob http://php.net/glob

PHP Code:
<?php

$files  
glob("*.bmp");
????: NamePros.com http://www.namepros.com/code/83462-getting-a-list-files-directory-thread.html

$string implode(":"$files);

// String now contains file1.bmp:file2.bmp:etc.
echo $string;

?>
deadserious is offline  
Old 04-18-2005, 03:07 PM THREAD STARTER               #3 (permalink)
NamePros Regular
 
selfmindead's Avatar
Join Date: Nov 2004
Location: Orange County, California.
Posts: 389
selfmindead is on a distinguished road
 



thanks alot that worked perfectly!!!
__________________
My del.icio.us
selfmindead is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP includes refererencing files from different directory thread FreeBaGeL Programming 6 03-08-2005 12:10 PM
public_html redhippo Web Design Discussion 8 02-27-2005 12:47 PM
2 Huge Name Forsale Vegas Entertainment Domains For Sale - Make Offer 9 09-21-2004 02:37 PM
List of all available ONE WORD domains: .com, .net, .info ncchinh For Sale / Advertising Board 7 09-10-2004 11:42 PM

 
All times are GMT -7. The time now is 07:44 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger