PHP program to reverse a string



   The below program can be used to reverse a given string using a loop. The       PHP echo statement is used to output the result on the screen.


 for exmaple:
     input:xyz
     output:zyx


  code:-

<?php
$value="xyz";
//strrev is an inbuilt function of php
echo strrev($value);
?>

//output:
zyx

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post