My String is like this
$str="12345"
I want to get
$str1 = "1,2,3,4,5"
My String is like this
$str="12345"
I want to get
$str1 = "1,2,3,4,5"
explose to an array with str_split
and then implode
implode(str_split('testing'), ',')
will give you
t,e,s,t,i,n,g
samefor 1234
$strLen = strlen($s);
$o = '';
for($i =0; $i < $strLen; $i++) {
$comma = ($i < $strLen) ? ' , ' : '';
$o .= $strLen[$i] . $comma;
}
echo $o;