コード例 #1
0
ファイル: UTF8.php プロジェクト: gnribeiro/turim
 /**
  * Strips whitespace (or other UTF-8 characters) from the beginning and
  * end of a string. This is a UTF8-aware version of [trim](http://php.net/trim).
  *
  *     $str = UTF8::wptrim($str);
  *
  * @author  Andreas Gohr <*****@*****.**>
  * @param   string  $str        input string
  * @param   string  $charlist   string of characters to remove
  * @return  string
  */
 public static function trim($str, $charlist = NULL)
 {
     if ($charlist === NULL) {
         return trim($str);
     }
     return UTF8::wpltrim(UTF8::rtrim($str, $charlist), $charlist);
 }