string chop
Returns the argument string without trailing whitespace, including newlines.
Example 1. chop() example
$trimmed = Chop($line);
See also trim().