PHP Rtrim
$colors=trim("blue,red,green,",",");//remove last , with rtrim
Friendly Hawk
$colors=trim("blue,red,green,",",");//remove last , with rtrim