I have problems because I can't delete last, from my echo
with rtrim
while($t= mysql_fetch_array($asd)){
$rest = '
"'.$t['a'].'": "'.$t['b'].'",';
echo rtrim($rest,",");
output:
"1": "a"
"2": "b"
"3": "a"
"4": "b"
how I can achieve like this:
output:
"1": "a",
"2": "b",
"3": "a",
"4": "b"
I arleady trying with some rtrim
,explode
etc but its doesnt work
I arleady trying with rtrim this doesnt work here is my code:
while($t= mysql_fetch_array($asd)){
$str = '
"'.$t['a'].'": "'.$t['b'].'",';
echo rtrim($str, ",");