Return to Snippet

Revision: 57227
at May 22, 2012 23:24 by pruntrut


Initial Code
$str1 = 'foo bar';
$str2 = 'Foo bar';
$str3 = 'FOO BAR';
$str4 = 'фуу бар';
 
echo mb_convert_case($str1, MB_CASE_TITLE, 'utf-8'); // Foo Bar
echo mb_convert_case($str2, MB_CASE_TITLE, 'utf-8'); // Foo Bar
echo mb_convert_case($str3, MB_CASE_TITLE, 'utf-8'); // Foo Bar
echo mb_convert_case($str4, MB_CASE_TITLE, 'utf-8'); // Фуу Бар

Initial URL
http://www.stoimen.com/blog/2010/09/17/5-php-string-functions-you-need-to-know/

Initial Description
Change string first letter to uppercase

Initial Title
Change string first letter to uppercase

Initial Tags
php

Initial Language
PHP