选择语言 :

 Core_UTF8::ltrim

Strips whitespace (or other UTF-8 characters) from the beginning of a string. This is a UTF8-aware version of ltrim.

$str = UTF8::ltrim($str);

string Core_UTF8::ltrim( 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 ltrim($str, $charlist = null)
{
    if ( $charlist === null ) return ltrim($str);

    if ( UTF8::is_ascii($charlist) ) return ltrim($str, $charlist);

    $charlist = preg_replace('#[-\[\]:\\\\^/]#', '\\\\$0', $charlist);

    return preg_replace('/^[' . $charlist . ']+/u', '', $str);
}