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