The strrev Function
The strrev function reverses a string
so that the characters are in reverse order.
Syntax
strrev(string $string): string
Example
Let's reverse the string '12345':
<?php
echo strrev('12345');
?>
Code execution result:
'54321'
See Also
-
the
str_shufflefunction,
which shuffles the characters of a string -
the
array_reversefunction,
which reverses an array