Remove Multiple Spaces Before and After Characters PHP
say I have a string like so
Testing
How could I have it remove all sp开发者_开发知识库aces before the first letter, and all spaces after the last letter in the string.
Thanks!
Look here for all string functions in PHP.
http://php.net/manual/en/ref.strings.php
use trim(string)
use trim()
Be sure to have this close by: String functions in PHP
Try the trim function.
string trim ( string $str [, string $charlist ] )
精彩评论