strlen.php 332 B

1234567891011121314151617
  1. <?php
  2. /**
  3. * UTF8::strlen
  4. *
  5. * @package Kohana
  6. * @author Kohana Team
  7. * @copyright (c) Kohana Team
  8. * @copyright (c) 2005 Harry Fuecks
  9. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
  10. */
  11. function _strlen($str)
  12. {
  13. if (UTF8::is_ascii($str))
  14. return strlen($str);
  15. return strlen(utf8_decode($str));
  16. }