How to Reverse a String in PHP?

Problem:

You have a string(ex. gnirts a esrever rof si noitcnuf )(verrts) whose characters are written in reverse order. To, read the string, you’re looking a way to reverse the string.

Solution:

PHP has a built in function, strrev() which can reverse a string. You just mention a string in its parameter and it will return the reversed string.

To reverse our string, lets see the following example-

<?php
echo strrev("gnirts a esrever rof si noitcnuf )(verrts");
?>

Output:
strrev() function is for reverse a string