PHP Documentation by the PHP Documentation Group
(PHP 4, PHP 5, PHP 7, PHP 8)
strrev — Reverse a string
$string
) : string
Returns string
, reversed.
string
The string to be reversed.
Returns the reversed string.
Example #1 Reversing a string with strrev()
<?php
echo strrev("Hello world!"); // outputs "!dlrow olleH"
?>
Copyright © 1997 - 2016 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution 3.0 License or later. A copy of the Creative Commons Attribution 3.0 license is distributed with this manual. The latest version is presently available at » http://creativecommons.org/licenses/by/3.0/.