I didn't make this recursive because I only needed to check one directory but it wouldn't be hard for you to edit it a bit. I just made this to check a folder for duplicate pictures. Had close to 10,000 pictures ha. I realize there are a few programs out there that can do this but I get paid by the hour 
Code:
<?PHP
function checkduplicates($dir) {
if(substr($dir, -1, 1) != "/") {
//if the last character isnt a / then add it
$dir = $dir."/";
}
if(is_readable($dir)) {
//only continue if its readable
$files = scandir($dir);
foreach($files as $file) {
//loop through it
if(!is_dir($dir.$file) && file_exists($dir.$file)) {
//if its not a directory and the file exists
$hash = md5_file($dir.$file);
//creates the hash
if(strlen($a[$hash]) != 0) {
//already being used so put in duplicate array
$b[$hash] = $file;
} else {
//new key first array
$a[$hash] = $file;
}
} else {
//directory directory array
$c[] = "<a href='?q={$dir}{$file}/'>$file</a>";
}
}
}
return '<table>
<tr>
<td valign="top" class="title">Folders</td>
</tr>
<tr>
<td valign="top" class="cc"><pre>'.print_r($c, true).'</pre></td>
</tr>
<tr>
<td valign="top" class="title">Duplicates</td>
</tr>
<tr>
<td valign="top" class="cc"><pre>'.print_r($b, true).'</pre></td>
</tr>
<tr>
<td valign="top" class="title">Originals</td>
</tr>
<tr>
<td valign="top" class="cc"><pre>'.print_r($a, true).'</pre></td>
</tr>
</table>';
}
//not much security so dont make this public lol
$file = $_GET['q'];
if(!is_dir($file)) {
//default location
$file = "/";
}
?>
<html>
<head>
<title>File Duplicate Detector</title>
<style>
body {
background: #e7e7e7;
}
td.title {
background: #949494;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
}
td.cc {
background: #bebebe;
border-left: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
}
</style>
</head>
<body>
<form method="get">
<input style="width:350px;" type="text" name="q" value="<?=$file?>">
<input type="submit" value="Search!">
</form>
Duplicate files in <?=$file?>:<br /><br />
<?PHP
//calls the function
echo checkduplicates($file);
?>
</body>
</html>
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum