PHP array and implode with blank/null values PHP array and implode with blank/null values arrays arrays

PHP array and implode with blank/null values


I think you can use array_filter to your array before use implode() function

$address = implode("\n", array_filter($addressarray));


try to use array_filter() on the $adressesarray, it filters empty values.For more array_filter()