Be careful, it does not work with unicode strings.
<?php
php > $str = '1¥';
php > print($str);
1¥
php > print(strrev($str));
��1
?>
(PHP 4, PHP 5)
strrev — Reverse a string
Returns string, reversed.
The string to be reversed.
Returns the reversed string.
Example #1 Reversing a string with strrev()
<?php
echo strrev("Hello world!"); // outputs "!dlrow olleH"
?>
Be careful, it does not work with unicode strings.
<?php
php > $str = '1¥';
php > print($str);
1¥
php > print(strrev($str));
��1
?>
This function support utf-8 encoding
function utf8_strrev($str){
preg_match_all('/./us', $str, $ar);
return join('',array_reverse($ar[0]));
}