PHP trim Function
What is trim Function?
In PHP, this function is used strip whitespace or other characters from the beginning and end of a string.
In the above syntax given "string" is the input to strip characters, "charlist" specify the following characters to remove " ","t","n","x0B","r"," ",if none is specified all the characters are removed.
= "ttThese are a few words :) ... ";
echo "Without trim:".$text;
echo "With trim:".trim($text);
Without trim: These are a few words :) ...
With trim: These are a few words :) ...
In the above example the tab spaces,white spaces are removed from the string and displayed.