how to remove comma at last positon in php code example Example: remove last comma from string php rtrim($my_string, ',');