PHP strrev() Function

Example

Reverse the string "I love Shanghai!":

<?php
echo strrev("I love Shanghai!");
?>

Run Instance

Definition and Usage

The strrev() function reverses the string.

Syntax

strrev(string)
Parameter Description
string Required. Specifies the string to be reversed.

Technical Details

Return Value: Return the reversed string.
PHP Version: 4+