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