简体   繁体   中英

Parse array to string?

I have an array $test .

print_r($test) :

Array ( [0] => aa 
        [1] => cc 
        [2] => bbb ) 

What is the best method for parse this to get the string:

aa, cc, bbb

I want this string in variable the $parse .

尝试使用implode()

$string = implode(', ', $your_array);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM