PHP 7.1.0 Released

strrev

(PHP 4, PHP 5)

strrevInverte una stringa

Descrizione

string strrev ( string $string )

Restituisce la stringa string invertita.

Example #1 Invertire una stringa con strrev()

<?php
echo strrev("Hello world!"); // outputs "!dlrow olleH"
?>

add a note add a note

User Contributed Notes 1 note

up
14
carmel.alex at gmail.com
10 years ago
This function support utf-8 encoding

function utf8_strrev($str){
    preg_match_all('/./us', $str, $ar);
    return join('',array_reverse($ar[0]));
}
To Top