Name

trim() — Trim characters from both ends of a string

Common Usage

trim( text )
trim( text, extra )

Description

The trim() function returns a copy of text that has been stripped of any prefix or suffix that consists solely of characters from extra . Characters from extra that are contained in the body of text remain untouched.

If extra is not provided, it is assumed to consist of the ASCII space (0x20) character. By default, tab characters and other whitespace are not trimmed.

See Also

ltrim(), rtrim()