trim.php 396 B

123456789101112131415161718
  1. <?php
  2. /**
  3. * UTF8::trim
  4. *
  5. * @package KO7
  6. *
  7. * @copyright (c) 2007-2016 Kohana Team
  8. * @copyright (c) since 2016 Koseven Team
  9. * @copyright (c) 2005 Harry Fuecks
  10. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
  11. */
  12. function _trim($str, $charlist = NULL)
  13. {
  14. if ($charlist === NULL)
  15. return trim($str);
  16. return UTF8::ltrim(UTF8::rtrim($str, $charlist), $charlist);
  17. }