too long

I wrote a simple function (copied and adapted, more like it!) to make breadcrumb for one application. My folder structure is such that if some folders are ignored, the trail would still work. I have looked it for far too long with no progress ...

function breadCrumb(){

// folders to ignore 
    $filterFolders = array('360', 'files');

if($location = substr(dirname($_SERVER['PHP_SELF']), 1)){
    $dirlist = explode('/', $location);
    }else{
    $dirlist = array();

    }
/** update the array with non required folders **/ 
$filteredArr = array_diff_key($dirlist, array_flip($filterFolders));

$count = array_push($filteredArr, basename($_SERVER['PHP_SELF']));

$address = 'http://'.$_SERVER['HTTP_HOST'];

    echo '<a href="'.$address.'">Home</a>';

for($i = 0; $i < $count; $i++){
    echo '&nbsp;&raquo;&nbsp;<a href="'.($address .= '/'.$filteredArr[$i]).'">'.ucfirst($filteredArr[$i]).'</a>';
    }
}

Thanks in advance, any help would be much appreciated!

I don't see any use of array_filter in your code, contrary to what's suggested by the question title. However, You should be running the difference function on values, not on keys (because you didn't specify any) in this case.

Hence

$filteredArr = array_diff_key($dirlist, array_flip($filterFolders));
                          ^

Should be

$filteredArr = array_diff($dirlist,$filterFolders); // you don't even ve to flip

For example

$filterFolders = array('360', 'files');

What would you expect those keys to be? they are 0 for the value 360 and 1 for the value 'files', so checking the difference of keys won't do what's expected.