Q:

Unzipping to a directory - return

I am unzipping files that are in the same directory to a folder call 'info'
This works fine, and it tells me each file that has been proccessed. 
The issue I have is it reporting back to me when there are no files to extract. 
This is my code:
    <? php

    $files = glob('*.{zip}', GLOB_BRACE);
    foreach($files as $file) {

    $zip = new ZipArchive;
    if ($zip->open($file) === TRUE) {
        $zip->extractTo('info');
        $zip->close();
        unlink($file);
        echo $file.'  extracted sucessfully<br>';
       } else {
        echo 'failed';
    }
}
? >

Can anyone help out to show a message when there are no .zip files in the directory to unzip? 
Thanks. 

A:

<? php

$files = glob('*.{zip}', GLOB_BRACE);
if (count($files) == 0) {
    echo 'No files to extract';
} else {

foreach($files as $file) {

$zip = new ZipArchive;
if ($zip->open($file) === TRUE) {
    $zip->extractTo('info');
    $zip->close();
    unlink($file);
    echo $file.'  extracted sucessfully<br>';
   } else {
    echo 'failed';
}

}
}
? >

This now works, just by checking the amount of zip files in the directory before executing the zip function.