Hello friend, welcome to my today's post on PHP. In my last tutorial, we learned about "How to substr function works?". Hope you enjoyed that tutorial.
Today we are going to learn about "How trim function work in php?". So, Let's start -
One of the most important function to remove starting and ending space from a string. This function returns a string with whitespace stripped from the beginning and end of str. Without the second parameter, trim() will strip these characters.
Have a look examples-

You can also specify the characters you want to strip, by means of the charlist parameter. Simply list all characters that you want to be stripped. You can also specify a range of characters.
string trim ( string str [, string charlist] )
Example 1. trim () example

The optional charlist parameter was added in PHP 4.1.0
Was this information useful? What other tips would you like to read about in the future? Share your comments, feedback and experiences with us by commenting below!
Like our site? Be a member of Coolajax fan page to get daily posts updates!
You May Like This Posts!
Tags:
trim function, how to use trim function, strip string, trim a string, remove space from string, trim function parameters. trim function example,trim function demo,remove starting and ending space from a string
Total Read: 637 Topics