How to check if the file input field is empty?

This should work

if ( ! empty($_FILES)) {...}

The other answers didn't work for me. So I post my solution:

if($_FILES['theFile']['name']=='')
{
    //No file selected
}

if($_FILES["file"]["error"] != 0) {
//stands for any kind of errors happen during the uploading
} 

also there is

if($_FILES["file"]["error"] == 4) {
//means there is no file uploaded
}

Here's what worked for me:

if ($_FILES['theFile']['tmp_name']!='') {
    // do this, upload file
} // if no file selected to upload, file isn't uploaded.