php string trim everything to right code example Example: trim | from right in php $DATA=trim("abc|1|test|","|");