What function can I use?
Asked
Active
Viewed 337 times
0
-
trim().Sorry, I just forgot this function. – Steven Dec 12 '09 at 08:30
-
1@Filburt Your [possible duplicate](http://stackoverflow.com/q/122616/1267661) is in C not PHP. I would use trim() like the accepted answer here... – Sam Aug 25 '12 at 23:41
5 Answers
3
left most
ltrim('text');
right most
rtrim('text');
but shortcut of above two is simply
trim('text');

Sarfraz
- 377,238
- 77
- 533
- 578
0
string trim ( string $str [, string $charlist ] )
This function returns a string with whitespace stripped from the beginning and end of str

pek
- 17,847
- 28
- 86
- 99