PKPString::ucfirst PHP Method

ucfirst() static public method

See also: http://ca.php.net/manual/en/function.ucfirst.php
static public ucfirst ( $string ) : string
$string string Input string
return string ucfirst version of input string
    static function ucfirst($string)
    {
        if (defined('ENABLE_MBSTRING')) {
            require_once './lib/pkp/lib/phputf8/mbstring/core.php';
            require_once './lib/pkp/lib/phputf8/ucfirst.php';
        } else {
            require_once './lib/pkp/lib/phputf8/utils/unicode.php';
            require_once './lib/pkp/lib/phputf8/native/core.php';
            require_once './lib/pkp/lib/phputf8/ucfirst.php';
        }
        return utf8_ucfirst($string);
    }

Usage Example

 /**
  * @see TypeDescription::parseTypeName()
  */
 function parseTypeName($typeName)
 {
     // Standard validators are based on string input.
     parent::parseTypeName('string');
     // Split the type name into validator name and arguments.
     $typeNameParts = explode('(', $typeName, 2);
     switch (count($typeNameParts)) {
         case 1:
             // no argument
             $this->_validatorArgs = '';
             break;
         case 2:
             // parse arguments (no UTF8-treatment necessary)
             if (substr($typeNameParts[1], -1) != ')') {
                 return false;
             }
             // FIXME: Escape for PHP code inclusion?
             $this->_validatorArgs = substr($typeNameParts[1], 0, -1);
             break;
     }
     // Validator name must start with a lower case letter
     // and may contain only alphanumeric letters.
     if (!PKPString::regexp_match('/^[a-z][a-zA-Z0-9]+$/', $typeNameParts[0])) {
         return false;
     }
     // Translate the validator name into a validator class name.
     $this->_validatorClassName = 'Validator' . PKPString::ucfirst($typeNameParts[0]);
     return true;
 }
All Usage Examples Of PKPString::ucfirst