Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以更改或转换用逗号分隔的字符串/整数?
例子 :
$str = "121,232,343,454";
应该导致:
str1,str1,str1,str1
不推荐使用 split() !!!请改用explode($seperator, $string)。
$str = "a,b,c"; $items = explode(',', $str);
根据您使用的语言,这通常是split($str, ',')or split(',', $str)or$str.split(',')函数
split($str, ',')
split(',', $str)
$str.split(',')