Page 1 of 1

Very simple question - changing variable case

Posted: Fri Aug 15, 2003 10:00 am
by starsol
I can't find a function for this on the PHP manual website but I'm sure there must be one.

Say I have a variable that has a value of "A", how can I change it so it is lower case (so therefore "a") ?

Anyone know?

Posted: Fri Aug 15, 2003 10:07 am
by Wayne
$lowerVariable = strtolower($Variable);

Posted: Fri Aug 15, 2003 10:09 am
by m3rajk
you probably didn't look up something close enough.

try checking

strtolower
strtoupper
ucfirst
ucwords

if this is for a comparison, look up

strcasecomp

Posted: Fri Aug 15, 2003 10:11 am
by starsol
Cheers Wayne 8).

I never thought of looking for upper or lower :oops:, just trawled through every function that had case in it.