选择语言 :

 Core_UTF8::trim

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 ] )
author
Andreas Gohr andi@splitbrain.org

参数列表

参数 类型 描述 默认值
$str string Input string
$charlist string String of characters to remove null
返回值
  • string
File: ./core/classes/utf8.class.php
public static function trim($str, $charlist = null)
{
    if ( $charlist === null ) return trim($str);

    return UTF8::ltrim(UTF8::rtrim($str, $charlist), $charlist);
}