You can count the items contained in the folder. The first two items are .
and ..
, so just check the items count.
$files_in_directory = scandir('path/to');
$items_count = count($files_in_directory);
if ($items_count <= 2)
{
$empty = true;
}
else {
$empty = false;
}