Aaron Fischer wrote:
        if (is_dir($item) && $item !='.' && $item!='..') {
            search($path . '/' . $item);
        }
        if (is_file($item)) {
            $file=file($item);
...

Don't forget that since you're not doing a chdir() before recursing that you're still looking at files in the context of your original working directory.

Change it to:

        $filepath = "${path}/${item}";
        if (is_file($filepath)) {
            $file=file($filepath);

and it should work.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to