Remove last value in an array elements :     <?php    
        $values = "aaa,bbb,ccc,ddd,";//Remove last comma
        $values = "aaa,bbb,,,";//Remove all commas before bbb like aaa,bbb
    ?>

How to remove commas in this example