在PHP中的foreach循环期间排除空输入字段

I have a form with 5 sets of inputs. An email and a key. I am creating an array for each set, then looping through them to send an email.

In some cases, not all 5 set of fields will be filled in. In my testing, this still sends a blank email. So I think I need to first create an array of each set of inputs, loop through them and then exclude the array or arrays that's empty?

Here is my current code, any help with an explanation so I can learn would be amazing!

if(isset($_POST['submit'])) {

  $donors = array_map(null, $_POST['email'], $_POST['key']);  

  foreach( $donors as $donor) {
    // Mail script will go here.
  }
}

Would I use another isset, or empty? And how?

Figured it out. It was pretty simple once I pointed myself in the right direction.

$donors = array_map(null, $_POST['email'], $_POST['key']);
foreach( $donors as $donor) {
  if(!empty($donor[0])&&!empty($donor[1])) {
    // Do something for all those arrays that are not empty
  }
}