PageRenderTime 61ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/system/utf8/strlen.php

https://bitbucket.org/drewsonne/ok-what-next
PHP | 17 lines | 7 code | 1 blank | 9 comment | 1 complexity | 2d7c1db3c871d6f76aa581745a58b5ee MD5 | raw file
Possible License(s): BSD-3-Clause
  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-2011 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. }