Ads

Uppercase-Lowercase Sentenceing using php

You can do many different things with PHP. Today we're going to focus on the uppercase and lowercase function and how to use it in different ways.


STRTOUPPER:
When using this term, it takes the $string from whatever it may be into all UPPERCASE lettering. Have a look at the example below.


CODE
<?php
$string 
"TotalDream is the BEST website on the net!";
$string strtoupper($string);
echo 
$string// Prints TOTALDREAM IS THE BEST WEBSITE ON THE NET!
?> 



You see how it works, now lets move on.


STRTOLOWER:
When using this term, it takes the $string from whatever it may be into all lower lettering. Have a look at the example below.


CODE
<?php
$string 
"TotalDream is the BEST website on the net!";
$string strtolower($string);
echo 
$string// Prints totaldream is the best website on the net!
?> 




UCFIRST:
This term makes the first words letter capital. View the example below to get it.


CODE
<?php
$string 
'hello people, this is totaldream!';
$string ucfirst($string);  // Hello people, this is totaldream!
echo $string;
?>




See this can be very simple if done correctly, next tutorial will be on simple math and what the possibilities can be when using it in the correct way Image Not Found

Friday July 27, 2007 - 572 reads