Sorry batman, but that won't work. empty() tests a var to see if it is set or not.
the handle will be set, so that won't work.
My guess is that he's getting .. and . as file names, so the test should probably be something like:
$c = 0;
while ($file = readdir($handle)&& $c<3) {
$c++;
}
if ($c>2){
print "Not empty";
} else {
print "Empty";
}