It doesn't SEEM to work implies that you aren't getting any errors but aren't getting any results. So I'll go with that.

I spotted this code

$start=$end

It should be $start-$end

No '='

Other than that, if you can't get it to work, make sure that

the $console var checks out ok, as in it's an existing directory with 777 permissions.

Also make sure $start and $end exist too. It's probably more likely that if you make the minor code modifications and check the permission of the directory which you are searching it will come through for you.