PHP Remove Empty Array Elements
There are various ways to remove empty array elements. The example shows the most efficient one:
<?php
$arr = ['', 'a', '', 'b', 'c'];
$new_arr = array_diff($arr, [''])
var_dump($new_arr);
?>
Code execution result:
['a', 'b', 'c']