Home >Backend Development >PHP Tutorial >Detailed explanation of the usage of php reverse string function strrev() function
strrev()Usage of function is a very fun function. Its main function is to reverse the string head to tail and return the reversed result
Haha, it’s fun. I really want to make a function encyclopedia website, but my energy is limited. I am busy enough just writing WEB development notes and updating one article a day Well, because my career is not just about writing this blog, there are also many other websites that need to be maintained. I just write soft articles and publish original works every day. It’s really tiring. Okay, if I have the opportunity in the future, I We still need to build a function encyclopedia network, and I hope everyone will support it.
Definition and usage
strrev() function reverses a string.
Syntax
strrev(string)
Parameter Description
string Required. Specifies the string to reverse.
Example
The code is as follows:
<?php echo strrev("Hello World!"); ?>
Output:
!dlroW olleH
For example:
The code is as follows :
<?php $str="Hello world"; $result=strrev($str); echo $result; //输出的结果是:dlrow olleH; ?>
The above is the detailed content of Detailed explanation of the usage of php reverse string function strrev() function. For more information, please follow other related articles on the PHP Chinese website!