PHP strrev is an inbuilt function in PHP which reverses the input string. It takes a string in the parameter and returns the reverse of that string. In this article, we will discuss the PHP strrev Function. Also, we will discuss a few examples of using it.
Syntax
strrev ($input_string);
Parameters
The function expects one parameter. The input string which you want to reverse is passed as the parameter.
Return Value
The function returns the reverse of the input string.
Input: strrev('Hello World!') Output: !dlroW olleH

Example
<?php $inputString = 'Hello World!'; $reverseString = strrev($inputString); ?>
In the above example, the function returns the reverse of the string.
OUTPUT: !dlroW olleH
Conclusion
You can read more about PHP strrev on the Official Documentation of PHP. Additionally, you can read more about PHP String Functions on Concatly.

Vishesh is currently working as a Lead Software Engineer at Naukri.com. He passed out of Delhi College of Engineering in 2016 and likes to play Foosball. He loves traveling and is an exercise freak. His expertise includes Java, PHP, Python, Databases, Design and Architecture.