CoreFiles by mySites.guru
ucfirst.php34 lines, 836 bytes, from Joomla_1.6.2-Stable-Full_Package.zip
Raw History Compare with 1.6.1
md5
61a97b5dd0e674bbeae0a1aa21891b6e
sha1
de89823c0dd07e28ba736b7aa5bed9ce6cd38dbf
sha256
4491d3e8b7a93961128185f0e814e86cd860c4df604a07e061f844422143bc70
<?php
/**
* @version $Id: ucfirst.php 16235 2010-04-20 04:13:25Z pasamio $
* @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 7 releases, Joomla 1.6.0 to 1.6.6. See them all, or every version of this file.