Jordan Savant // Software Engineer

<?php

function rglob($pattern='*', $flags = 0, $path='')
{
    $paths=glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);
    $files=glob($path.$pattern, $flags);
    foreach ($paths as $path) { $files=array_merge($files,rglob($pattern, $flags, $path)); }
    return $files;
}

$files = rglob();
$all = array();

foreach($files as $file)
{
    $pathInfo = pathinfo($file);
    $temp = strtolower($pathInfo['basename']);

    foreach($all as $real => $lower)
    {
        if($lower == $temp)
        {
            if($real != $pathInfo['basename'])
            {
                echo "Duplicate: ".$pathInfo['basename'] . " => ". $real ."\n";;
            }
        }
    }

    $all[$pathInfo['basename']] = $temp;
}