PHP array and implode with blank/null values

前端 未结 2 1582
余生分开走
余生分开走 2021-01-18 13:50

I have a array which i generated by values in a database, the example is below:

$addressarray = array($results[\'client\']->client_city, $results[\'client         


        
相关标签:
2条回答
  • 2021-01-18 14:23

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

    $address = implode("\n", array_filter($addressarray));
    
    0 讨论(0)
  • 2021-01-18 14:23

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

    0 讨论(0)
提交回复
热议问题