Jump to content


Photo

Directory Listing


  • Please log in to reply
2 replies to this topic

#1 abhilashdas

abhilashdas
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 September 2006 - 05:06 AM

Can anybody tell me how to list files of a specified file types from a directory???

#2 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 24 September 2006 - 07:10 AM

opendir
readdir

#3 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 24 September 2006 - 05:11 PM

Try this:
<?php
//
// An example if you want all of a specific file type in a directory. 
//
$Gdir = "fotos/";
foreach (glob("$Gdir/{*.jpg,*.png,*.gif}", GLOB_BRACE) as $file)
    echo $file.'<br>';
?>

Ronald  8)
RTFM is an almost extinct art form, it should be subsidized.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users