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