strlen.php 359 B

123456789101112131415161718
  1. <?php
  2. /**
  3. * UTF8::strlen
  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 _strlen($str)
  13. {
  14. if (UTF8::is_ascii($str))
  15. return strlen($str);
  16. return strlen(utf8_decode($str));
  17. }