Name

trim

Synopsis

string trim(string string[, string characters])

Returns string with every whitespace character in characters stripped from the beginning and end of the string. You can specify a range of characters to strip using .. within the string. For example, "a..z" would strip each lowercase alphabetical character. If characters is not supplied, \n, \r, \t, \x0B, \0, and spaces are stripped.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.