File: index.php

Recommend this page to a friend!
  Classes of Ravi Kumar  >  PHP SPL File Find  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP SPL File Find
SPL iterator to find files with different criteria
Author: By
Last change: Added File Size and Depth Filter
Date: 6 years ago
Size: 352 bytes
 

Contents

Class file image Download
<?php

include_once 'Find.php';

//$path = realpath( 'D:\xampp\htdocs\webloper\Gallery\uploads' );

$path = realpath( 'Your Path' );

$find = new Find;
$files = $find->depth(2)->in( $path );

$index = 1;
foreach(
$files as $key => $file) {
    echo
'<pre> ' , $index . ' ' , print_r($file, 1), ' ', print_r($file->getSize(), 1), '</pre>';
   
$index++;
}


For more information send a message to info at phpclasses dot org.