$holder = \'\'; foreach($fields as $key){ $holder .= $key.\', \'; } echo $holder;
I have the code above, it outputs \"a, b, c, \" I want to r
You can use substr like this
$holder = ''; foreach($fields as $key){ $holder .= $key.', '; } $newholder=substr($holder, 0, -1); echo $newholder;