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

Tuesday, September 16, 2008

The strtouper() function

This function returns a given string in upper case.

Syntax: strtoupper(string);

Example input:

$str1=" my PrOgRam";
echo $str1;
echo "
";
echo strtoupper($str1);

Example output:

my PrOgRam
MY PROGRAM

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);