Strips whitespace (or other UTF-8 characters) from the beginning and end of a string. This is a UTF8-aware version of trim.
$str = UTF8::trim($str);
string Core_UTF8::trim( string $str [, string $charlist = null ] )
参数列表
参数 类型 描述 默认值 $str
string
Input string $charlist
string
String of characters to remove null
string
public static function trim($str, $charlist = null)
{
if ( $charlist === null ) return trim($str);
return UTF8::ltrim(UTF8::rtrim($str, $charlist), $charlist);
}