trim - remove whitespace
The trim function removes whitespace characters from the start or the end of a string (also known as leading and trailing whitespace characters).
"Whitespace characters" are characters such as Spaces, Tabs, New Lines
Source: http://en.wikipedia.org/wiki/Whitespace_character
Usage(s)
trim ( $string ) |
Returns a string without whitespace at the start or end |
Parameter(s)
$string |
The string where whitespace needs to be removed from the start or end position |
Example(s)
Removing (or trimming) whitespace from a string
trim( s t r i n g )
returns "s t r i n g"
trim( string )
returns "string"
|
See also
strip - remove all whitespace
truncate - truncate string length