PHP array and implode with blank/null values

前端 未结 2 1613
余生分开走
余生分开走 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));
    

提交回复
热议问题