I have a array which i generated by values in a database, the example is below:
$addressarray = array($results[\'client\']->client_city, $results[\'client
I think you can use array_filter to your array before use implode() function
implode()
$address = implode("\n", array_filter($addressarray));
try to use array_filter() on the $adressesarray, it filters empty values. For more array_filter()
array_filter()
$adressesarray