Formula for (PHP 3, PHP 4, PHP 5)
chop -- Alias of rtrim()
chop(string str,string charlist)

Parameter
string str = Required. Specifies the string to check
string charlist = Optional. Specifies which characters to remove from the string.

Description
chop() removes all trailing whitespace characters from the given string. These characters include the horizontal tab\t), linefeed (\n), vertical tab\013), carriage return (\r), and space' '') characters.

Example
In this example we will use the chop() function to remove characters from the right end of a string



The output of the code :