Current location: Hot Scripts Forums » Programming Languages » PHP » show folders and files


show folders and files

Reply
  #1 (permalink)  
Old 06-14-05, 11:49 AM
kalinchuk kalinchuk is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: ...
Posts: 110
Thanks: 0
Thanked 0 Times in 0 Posts
show folders and files

how can i print out the folders and files in a certain folder
Reply With Quote
  #2 (permalink)  
Old 06-14-05, 11:56 AM
ibzi ibzi is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

<?php

$dir 
"/your_folder/";

// Open the folder and do a loop to read it's content
if (is_dir($dir)) {
   if (
$dh opendir($dir)) {
       while ((
$file readdir($dh)) !== false) {
           echo 
"filename: $file : filetype: " filetype($dir $file) . "\n";
       }
       
closedir($dh);
   }
}
?>
__________________
--
Help us Fight SPAM!
Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Host Manager software??? Grüssle Script Requests 3 08-09-05 03:39 PM
Get instant access to your PC (files, mails, webcam…) from your mobile. Simonet General Advertisements 0 03-16-05 09:21 AM
Zipping folders and subfolders Infinite_Hackers PHP 9 08-23-04 07:10 AM
Reading .lnk file(shortcut files in windows) anupamsr PHP 5 04-22-04 02:42 PM
Folder and their files jimbo HTML/XHTML/XML 1 01-11-04 10:40 AM


All times are GMT -5. The time now is 06:50 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.