-1
我想将数字串变成逗号分隔值。将数字串转换为逗号分隔值
我已经试过这样:
$str = 12345;
$newStr = "'" . str_replace("",",", $str) . "'";
print_r($newStr);
预期输出: - 1,2,3,4,5
我想将数字串变成逗号分隔值。将数字串转换为逗号分隔值
我已经试过这样:
$str = 12345;
$newStr = "'" . str_replace("",",", $str) . "'";
print_r($newStr);
预期输出: - 1,2,3,4,5
试试这个
$str = 12345;
$arr= str_split($str); //will output in array
echo implode(',',$arr); //convert array to string with delimiter
https://eval.in/664071像这样? –
Ninad检查下面的答案。谢谢 –
人没有回答答案。 –