开发者

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  ] )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜