Codice PHP:
foreach ($array as $k => $v) {
      if (
is_null($v) || trim($v)=='') {
        unset(
$array[$k]);
      }
    }