August 17, 2024
PHP reverse string with strrev() function
If you want to reverse any string then you can do this with using strrev() function. strrev function required one string argument for arranging in reverse order. The example of strrev() function is mentioned below:
Code
<?php
$msgVariable = "Hello";
$revMsg = strrev($msgVariable);
echo $revMsg;
?>
The output of the above mentioned program would be
Output
olleH