Change to lower 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
User avatar
cto1mac
Forum Commoner
Posts: 54
Joined: Tue Jan 27, 2004 6:11 am
Location: Virginia Beach, VA

Change to lower case

Post by cto1mac »

Ok in ASP/VBScript I can do:

LCase(variable) and it will turn the variable into lowercase.

How do I do this in PHP??

Thanks
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

like this

Code: Select all

<?php
$str = "MY UPPERCASE VARIABLE";
$str = strtolower($str);
echo $str; // Prints my uppercase variable
?>
Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

hope this helps

Code: Select all

<?php
$smallcase = "This will All Go LOWERCASE";
$str = strtolower($smallcase);
echo $str;
?>
edit : damn he beat me again!!!
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Always one step ahead buddy :)

Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

Code: Select all

<?php
if ($bech100 > $malcolmboston) {
   echo "Cant Beat Him, So Be More Concise";
} else {
   echo "No Longer A Noob";
}
?>
adding onto your question.........

to change all to uppercase

Code: Select all

<?php 
$uppercase = "This will All Go UPPERCASE"; 
$str = strtoupper($uppercase); 
echo $str; 
?>
Hope that helps for the future
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

hahaha, trying to be a step ahead og me now :)

Mark
Post Reply