Very simple question - changing variable case

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
starsol
Forum Newbie
Posts: 24
Joined: Thu Jul 31, 2003 8:30 am
Location: Norfolk, England.
Contact:

Very simple question - changing variable case

Post 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?
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

$lowerVariable = strtolower($Variable);
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post 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
starsol
Forum Newbie
Posts: 24
Joined: Thu Jul 31, 2003 8:30 am
Location: Norfolk, England.
Contact:

Post 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.
Post Reply