简体   繁体   中英

Move all values of array into one variable in PHP

I have a very simple question.

Imagine I have this array :

$array = array("one","two","three");

I want to merge all values into one variable :

$array = "one,two,three";

How to do it ?

通过使用这个:

$variable = implode(",",$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