What are the different methods to remove absätze from an array in PHP?

Absätze in an array can be removed in PHP using various methods such as using array_filter() function, looping through the array and checking for empty values, or using array_values() function to reindex the array without empty values.

// Method 1: Using array_filter() function
$array = array("This", "is", "a", "", "test");
$array = array_filter($array, 'strlen');
print_r($array);

// Method 2: Looping through the array and checking for empty values
$array = array("This", "is", "a", "", "test");
foreach ($array as $key => $value) {
    if ($value == "") {
        unset($array[$key]);
    }
}
print_r($array);

// Method 3: Using array_values() function to reindex the array without empty values
$array = array("This", "is", "a", "", "test");
$array = array_values(array_filter($array));
print_r($array);