php remove last if comma code example Example: remove last comma from string php rtrim($my_string, ',');