PHP: Proper Case Function for PHP Strings

Yes, PHP does have a proper case function for strings: ucwords($string)

If you’re looking for the lower and upper case string functions…here you go:

strtolower($string);

strtoupper($string);

Why not a strtoproper(), just to keep it consistent? Well, consistency here wouldn’t exactly be consistent for PHP, would it ;-) ?

One Response to PHP: Proper Case Function for PHP Strings

  1. Random June 11, 2009 at 9:33 pm #

    This will upper case only the first letter:

    ucfirst ( $string );

    It works for one sentence but it wouldn’t be much help for a paragraph or more.

Powered by WordPress. Designed by Woo Themes