Showing posts with label display directory. Show all posts
Showing posts with label display directory. Show all posts

Tuesday, January 29, 2013

How to display the file and directory list.

This code run php versions >= 5.1.2

This code is very useful and simple display the particular path directory and file list.

<?php

$path = "C:/xampp/htdocs/samplejoomla/application/controllers/administrator/";


$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);

foreach($objects as $name => $object){
   echo "$name\n"."<br/>";
  }


?>