PHP Classes

Changed the parseDirectory function to : function parseDirect...

Recommend this page to a friend!

      PHP Duplicate Files Finder  >  All threads  >  Changed the parseDirectory function...  >  (Un) Subscribe thread alerts  
Subject:Changed the parseDirectory function...
Summary:Package rating comment
Messages:1
Author:Felix Mrdx
Date:2017-02-01 21:03:15
 

Felix Mrdx rated this package as follows:

Utility: Sufficient
Consistency: Sufficient
Examples: Sufficient

  1. Changed the parseDirectory function...   Reply   Report abuse  
Picture of Felix Mrdx Felix Mrdx - 2017-02-01 21:03:15
Changed the parseDirectory function to :
function parseDirectory($rootPath, $returnOnlyFiles = true, $seperator = "/"){
$fileArray = array();
if (($handle = opendir($rootPath)) !== false) {
while( ($file = readdir($handle)) !== false) {
if($file != '.' && $file != '..' && stristr($file, "pdf")){
if (is_dir($rootPath.$seperator.$file)){
$array = $this->parseDirectory($rootPath.$seperator.$file);
$fileArray = array_merge($array, $fileArray);
if($returnOnlyFiles !== true){
$fileArray[] = $rootPath.$seperator.$file;
}
}
else {
if($returnOnlyFiles != true){
$fileArray[] = $rootPath.$seperator.$file;
}
else{
$fileArray[] = $file;
}
}
}
}
}
return $fileArray;
}