Forum Moderators: coopster
$str = "A product, B product, C product, D product, E product,";
$str = substr($str, 0, strlen($str)-1);
However, Birdman's solution is unnecessarily complicated. You don't need to know the string length. Just do this
$str = substr($str, 0, -1);
That will cut the last char off a string. From the manual:
If length is given and is negative, then that many characters will be omitted from the end of string
Tom