CoreFiles by mySites.guru
ucfirst.php33 lines, 771 bytes, from Joomla_2.5.4-Stable-Full_Package.zip
Raw History Compare with 2.5.3
md5
3c1be5dc2032ce9c711e97a28d51346e
sha1
2262c010134a40d755b861d0d56730a65a3384a7
sha256
231066e7d2fbbc17c8afe80600a4ec0b68309abf04572203343df81c20e6c5b2
<?php
/**
* @package utf8
* @subpackage strings
*/

//---------------------------------------------------------------
/**
* UTF-8 aware alternative to ucfirst
* Make a string's first character uppercase
* Note: requires utf8_strtoupper
* @param string
* @return string with first character as upper case (if applicable)
* @see http://www.php.net/ucfirst
* @see utf8_strtoupper
* @package utf8
* @subpackage strings
*/
function utf8_ucfirst($str){
    switch ( utf8_strlen($str) ) {
        case 0:
            return '';
        break;
        case 1:
            return utf8_strtoupper($str);
        break;
        default:
            preg_match('/^(.{1})(.*)$/us', $str, $matches);
            return utf8_strtoupper($matches[1]).$matches[2];
        break;
    }
}

The same content is in 5 releases, Joomla 2.5.0 to 2.5.4. See them all, or every version of this file.