Showing posts with label string reversal. Show all posts
Showing posts with label string reversal. Show all posts

Saturday, September 13, 2008

The strrev() function

This function is used to reverse any given string.
Syntax: strrev(string);

Example inputs:

$str1= "A simple PHP program";
echo $str1."
";
$str2 = strrev($str1);
echo $str2."
";
echo $str1."
";
echo strrev($str1);