PageRenderTime 59ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/core/utf8/strlen.php

https://github.com/allentje/kohana_core
PHP | 17 lines | 7 code | 1 blank | 9 comment | 1 complexity | 6ea23780633eabd8ed3d8b1e968577f8 MD5 | raw file
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2. /**
  3. * UTF8::strlen
  4. *
  5. * @package Kohana
  6. * @author Kohana Team
  7. * @copyright (c) 2007-2008 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. }