Login   Register  
PHP Classes
elePHPant
Icontem

File: usage.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Er. Rochak Chauhan  >  PHP Duplicate Files Finder  >  usage.php  >  Download  
File: usage.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: PHP Duplicate Files Finder
Find files with the same contents
Author: By
Last change:
Date: 4 years ago
Size: 689 bytes
 

Contents

Class file image Download
<?php
$dir
="../myClasses";
require(
"phpDuplicateFilesFinder.php");
$obj=new phpDuplicateFilesFinder();
$duplicateFiles=$obj->findDuplicateFiles($dir);

//Display Results
$c=count($duplicateFiles);
if(
$c===0){ echo "No Duplicate Files were found in \"$dir\""; }
else{
    echo 
"<div>$c duplicate files found in \"$dir\"</div>";
    
$col=0;
    foreach(
$duplicateFiles as $duplicate){
        
$c=count($duplicate);
        if(
$col%2==0){$color="#FFDFF8";} else {$color="#DFFFE3"; }
        echo 
"<p><br /></p><div style='background-color:$color'>";        
        for(
$a=0;$a<$c;$a++){
            
$file=$duplicate[$a];            
            echo 
"<div><a href='$file'>$file</a></div>";            
        }    
        echo 
"</div>";
        
$col++;    
    }
}
?>