Monday, May 18, 2015

Find out all files of a directory with function in php

In this topics we'll discus on "how to find out all files of a directory of web server". It will give you knowledge about working with files.

We will create a simple function to find out files of a directory.

function files()
$path = './uploads/';
if ($handle = opendir($path)) {
   while (false !== ($file = readdir($handle))) {
    echo $file.'<br/>';         }
After write this simple function now we can call this function as follow-
Now see it show a list of files name.


Post a Comment


Copyright @ 2014 Tech Tutorial .