Home >Backend Development >PHP Tutorial >Detailed explanation of the usage of php reverse string function strrev() function

Detailed explanation of the usage of php reverse string function strrev() function

怪我咯
怪我咯Original
2017-07-07 10:15:012135browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn