Hi,
Here's a slapped together function to try. It strips the whitespace off the end before lopping of the last character.
<?
$str = "a,b,c,";
echo "old: $str<br>\n";
echo "new: " . rchop($str) . "<br>\n";
function rchop($str) {
// Remove right whitespace
$new = rtrim($str);
$new1 = substr($new,0,sizeof($new)-2);
return $new1;
}
?>