PHP strrev() Function
Definition
The strrev() function reverses a string.
Syntax
PHP strrev() Function has the following syntax.
strrev(string)
Parameter
Parameter | Is Required | Description |
---|---|---|
string | Required. | String to reverse |
Return
PHP strrev() function returns the reversed string.
Example
Reverse the string "java2s.com!":
<?php
echo strrev("java2s.com!");
?>
The code above generates the following result.