show array with comma php and remove last comma with and code example Example: remove last comma from string php rtrim($my_string, ',');