Signatur
strrev(string $string): string
Beschreibung
strrev('Größe') liefert kaputte Bytes, da Multi-Byte-Zeichen zerlegt werden.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $string Pflicht | string | — | Eingabe. |
Rückgabewert
Typ
string
Beschreibung
Umgekehrter String.
Beispiele
ASCII
<?php
echo strrev('Hallo'); // ollaH
UTF-8-sicher
<?php
$chars = preg_split('//u', 'Größe', -1, PREG_SPLIT_NO_EMPTY);
echo implode('', array_reverse($chars)); // eßörG