Home > Article > Backend Development > PHP reverse string function strrev()
Example
ReverseString "Hello World!":
<?php echo strrev("Hello World!"); ?>
Definition and usage
strrev() FunctionReverse the string.
Syntax
strrev(string)
Parameters | Description |
string | Required. Specifies the string to reverse. |
Technical Details
Return value: | Returns the reversed string. |
PHP version: | 4+ |
<?php echo strrev("Hello World!"); ?>Output:
!dlroW olleHFor example:
<?php $str="Hello world"; $result=strrev($str); echo $result; //输出的结果是:dlrow olleH; ?>
The above is the detailed content of PHP reverse string function strrev(). For more information, please follow other related articles on the PHP Chinese website!