php remove last comma in string code example
Example 1: remove last comma from string php
rtrim($my_string, ',');
Example 2: php remove last character from string if comma
$string = rtrim($string, ',');
rtrim($my_string, ',');
$string = rtrim($string, ',');