PHP Classes

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: Update of index.php
Date: 2 months 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++;
}