strrev.php 415 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * UTF8::strrev
  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 _strrev($str)
  13. {
  14. if (UTF8::is_ascii($str))
  15. return strrev($str);
  16. preg_match_all('/./us', $str, $matches);
  17. return implode('', array_reverse($matches[0]));
  18. }