String Capitalization Functions: strtoupper-strtolower-ucwords.

In php you can easily manipulate the capitalization of your PHP strings, there are ready to use functions that help you to convert yout text to upper case, lower case, or just the first letter of every word to upper case.

<?php

$originalString = "Testing string Capitalization AbCDe";

$upperCase = strtoupper($originalString); // Result: TESTING STRING CAPITALIZATION ABCDE
$lowerCase = strtolower($originalString); // Result: testing string capitalization abcde
$ucTitleString = ucwords($originalString); // Result: Testing String Capitalization Abcde

?>


This does explain everything about how to manipulate capitalization. In fact strtoupper returns the string in upper case, strtolower converts to lower case, and ucwords capitalize the first letter of each word, without making any changes to other characters in the word. (ie tEsT becomes TEsT with ucwords).

If you have any question, I'm ready to help you.

11 comments:

Jenny said...

hi nice blog. submit your post in w3bookmarks.com

mjcatubay said...

Nyc Blog Go GO

SMS problem...

I found out there a free sending sms
you can make your own.

Try it...
There's a Example Codes

http://ask-php-codes.blogspot.com/

rize wordpress said...

Our experienced PHP Programmers work on your website from its conceptualization till its completion.

D3 Gold said...


Pleased to uncover your site as well as the fantastic photographs you have frequently! Buy RS Gold
Cheap Diablo 3 Items

china tours said...

What a beautiful dragonfly and what wonderful post!! You can learn more: China tour packages | China travel packages | China Travel Agency

Learn Chinese said...

AllMandarin is the only company that can give you an excellent alternative to learn Mandarin Chinese that is not only better, but also more efficient in terms of cost, flexibility and learning methods.I am a Chinese teacher,you can learn more about Free Chinese language info: Learn mandarin online | Learn mandarin Chinese | Mandarin Teacher

learning Chinese online said...

I'm learning to speak Chinese because I believe it's the only way to really learn about China.When I was searching for a place to learn to speak Chinese, I called several schools. Hanbridge was the best because they had excellent teachers and a very friendly and welcoming spirit. ?I really appreciate the opportunity to learn here and would recommend Hanbridge to others.

Divya Dheen said...

Thanks for the great information in your blog PHP Training in Chennai

Samartha Sri said...

wow really nice. It will be helpful for the people those who are ready to crack the interview and please also for remind what they have learned throughout concept.

HR Consultancy in Bangalore

Anil Gupta said...

I am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information.
Bangalore Web Designing Company, UI Designing Company Bangalore

Prasanth said...

I absolutely admired every bit of it and i additionally accept you book apparent to analysis out fresh things in your site.
UI Design Company Bangalore, Web Application Development Services in Bangalore