PHP Classes

PHP Scan Files in Directory: Scan files and directories with DirectoryIterator

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 70%Total: 301 All time: 7,390 This week: 78Up
Version License PHP version Categories
fsscan 1.0.0GNU General Publi...5PHP 5, Files and Folders
Description 

Author

This class can scan files and directories with DirectoryIterator.

It takes the path of a given directory and scans it to extract the list of files.

The class may optionally ignore hidden files that start with . and links.

It returns an array object with the list of files and their attributes JSON encoded.

Picture of Everton da Rosa
  Performance   Level  
Name: Everton da Rosa <contact>
Classes: 17 packages by
Country: Brazil Brazil
Age: 42
All time rank: 78956 in Brazil Brazil
Week rank: 95 Up7 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 3x

Example

<?php
try {
    require
'fsscan.php';

   
$nodes = new FSScan('/home/everton/Documentos/Prefeitura/Incategorizaveis');

   
//exibe o conte?do do ArrayObject
   
foreach ($nodes->getNodes() as $item){
        echo
'<pre>';
       
var_dump($item);
        echo
'<pre>';
        echo
'<hr>';

    }

   
//nodes como JSON
   
echo '<pre>', $nodes->getJSONNodes(), '</pre>';
} catch (
Exception $ex) {
    echo
$ex->getTraceAsString();
}
?>


  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example f use
Plain text file fsscan.php Class Class file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:301
This week:0
All time:7,390
This week:78Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:-
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:70%StarStarStarStar
Rank:315