Reverse String Function in PHP

Reverse String:-Reverse String Function in PHP

A string can be reversed either using strrev() function or simple PHP code. The strrev() function is the predefined function of PHP.

For example, on reversing ESTS it will become STSE

strrev():-

The strrev() function is used to reverse a string. It returns the reversed string. The strrev() function is a built-in function in PHP. This function does not make any change in the original string passed to it as a parameter.

Syntax:-

strrev(string)

Example:-

<!DOCTYPE html>
<html>
<body>

<?php
echo strrev("expound soft tech solution");
?>

</body>
</html>

OUTPUT:-

sexpoundsofttechsolution

Reverse String Function in PHP