Example output
1. test,test,test,test,test, 2. test,test,test,, 3. test,test,,, 4. test,,,,,
I tried use implode according to my previous q
rtrim('test,,,,,', ',');
See the manual.
completely different way:
$str = "1,2,3,4,"; $str = substr($str,0,strlen($str)-1);
rtrim for example:
$str = 'foo,bar,blah,bleh,'; echo rtrim($str,','); // foo,bar,blah,bleh