Depending on the intended meanings of your "empty" array values, e.g., null and empty string, vs. an integer 0 or a boolean false, be mindful of the result of different filters.
<?php
declare(strict_types=1);
$array = array( 'null' => null, 'nullstring' => '', 'intzero' => 0, 'stringzero' => '0', 'false' => false, 'stringfalse' => 'false', );
$filtered1 = array_filter( $array, 'strlen' );
$filtered2 = array_filter( $array, function( $v ) { return !is_null( $v ); } );
$filtered3 = array_filter( $array, function( $v ) { return !( is_null( $v) or '' === $v ); } );
var_dump( $array, $filtered1, $filtered2, $filtered3 );
?>
Results in:
array (size=3)
'intzero' => int 0
'stringzero' => string '0' (length=1)
'stringfalse' => string 'false' (length=5)
array (size=5)
'nullstring' => string '' (length=0)
'intzero' => int 0
'stringzero' => string '0' (length=1)
'false' => boolean false
'stringfalse' => string 'false' (length=5)
array (size=4)
'intzero' => int 0
'stringzero' => string '0' (length=1)
'false' => boolean false
'stringfalse' => string 'false' (length=5)