Rev | Line | |
---|
[3] | 1 | <?php |
---|
| 2 | |
---|
| 3 | /** |
---|
| 4 | * @version $Id: strrev.php,v 1.1 2006/02/25 13:50:17 harryf Exp $ |
---|
| 5 | * @package utf8 |
---|
| 6 | * @subpackage strings |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | /** |
---|
| 10 | * UTF-8 aware alternative to strrev |
---|
| 11 | * Reverse a string |
---|
| 12 | * @param string UTF-8 encoded |
---|
| 13 | * @return string characters in string reverses |
---|
| 14 | * @see http://www.php.net/strrev |
---|
| 15 | * @package utf8 |
---|
| 16 | * @subpackage strings |
---|
| 17 | */ |
---|
| 18 | function utf8_strrev($str) |
---|
| 19 | { |
---|
| 20 | preg_match_all('/./us', $str, $ar); |
---|
| 21 | return implode(array_reverse($ar[0])); |
---|
| 22 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.