This will allow you to remove the last N characters from a string in PHP. Just change the -1 to however many characters you want to remove.
$strTest = substr($strTest, 0, -1);
This is handy for removing a trailing ',' etc from a string concatenated in a for loop. eg. "ham,eggs,beans,"