コード例 #1
0
/**
 * Reverses a string.
 * @param string $string				The string to be reversed.
 * @param string $encoding (optional)	The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
 * @return string						Returns the reversed string.
 * This function is aimed at replacing the function strrev() for human-language strings.
 * @link http://php.net/manual/en/function.strrev
 */
function api_strrev($string, $encoding = null)
{
    return Utf8::strrev($string);
}
コード例 #2
0
 public function test_linefeed()
 {
     $str = "Iñtërnâtiôn\nàlizætiøn";
     $rev = "nøitæzilà\nnôitânrëtñI";
     $this->assertEquals($rev, u::strrev($str));
 }