【发布时间】:2018-06-22 21:04:24
【问题描述】:
我想删除短语开头和之后的空格,
$mystring = " Test Business Group Co.,Ltd ";
$mystring = "Test Business Group Co.,Ltd";
还有办法吗?
【问题讨论】:
-
trim()函数。 -
修剪($mystring)
标签: php
我想删除短语开头和之后的空格,
$mystring = " Test Business Group Co.,Ltd ";
$mystring = "Test Business Group Co.,Ltd";
还有办法吗?
【问题讨论】:
trim() 函数。
标签: php
您可以使用trim() 函数从字符串的开头和结尾删除空格:http://php.net/manual/en/function.trim.php
$string = " hello world ";
$better_string = trim($string);
-> "hello world"
【讨论】: