Hi everyone,

i want to make a script which can filter dir and files in a folder. i mean in a specified folder it create a list or dir's and files separately.

i had try open_dir function in php but it list all data together.


Plz help me do it.

thanks


Gajendra

You can do it using open_dir

You just have to think how to implement that like this:

<?php
//Open images directory
$dir = @ opendir("images");

//List files in images directory
while (($file = readdir($dir)) !== false)
  {
     if($file != "foo.txt")  echo "filename: " . $file . "<br />";
  }
closedir($dir);
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.