Php - How to find file and directory, Script to list directory content

How to find file and directory


<?php
/*
function that reads directory content and
returns the result as links to every file in the directory
also it display type whether its a file or directory
*/
function DirDisply() {
 $TrackDir=opendir(".");
 echo "";
 while ($file = readdir($TrackDir))  {
  if ($file == "." || $file == "..") { }
  else {
   echo "";
  }
 }
 echo "$file";
 closedir($TrackDir);
 return;
 }

/*Current Directory Contain
Following files and Sub Directories*/

DirDisply();
?>
The above script helps you to find whether the listed directories are files or a directories.

The topic on Php - How to find file and directory is posted by - Maha

Hope you have enjoyed, Php - How to find file and directoryThanks for your time

Tech Bluff