If have this array:
$a = array("one", "two", "three");
I want to transform this into this string:
$s = "one, two, three";
Eg:
$s = paste($a, sep=", ");
使用爆破 :
$s = implode(', ',$a);
$a = array("one", "two", "three");
foreach($a as $value) {
$string = $string . ($value != '' ? '' : ', ') . $value;
}
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.