How do you remove the lines that have empty elements from a multidimensional-array in PHP?
For instance, from:
1: a, b, c, d 2: d, _, b, a 3: a, b, _, _
Try this:
Note: $arr is your array.
foreach ( $arr as $key => $line ) { foreach ( $line as $item ) { if ( empty( $item ) ) { unset( $arr[$key] ); break; } } }
Cheers