public static function wordsFromCamelCase($strName)
    {
        if (strlen($strName) == 0) {
            return '';
        }

        $strToReturn = QString::firstCharacter($strName);

        for ($intIndex = 1; $intIndex < strlen($strName); $intIndex++) {
            // Get the current character we're examining
            $strChar = substr($strName, $intIndex, 1);

            // Get the character previous to this
            $strPrevChar = substr($strName, $intIndex - 1, 1);

            // If an upper case letter
            if ((ord($strChar) >= ord('A')) &&
                (ord($strChar) <= ord('Z'))
            ) { // Add a Space
                $strToReturn .= ' ' . $strChar;
            } // If a digit, and the previous character is NOT a digit
            else {
                if ((ord($strChar) >= ord('0')) &&
                    (ord($strChar) <= ord('9')) &&
                    ((ord($strPrevChar) < ord('0')) ||
                        (ord($strPrevChar) > ord('9')))
                ) { // Add a space
                    $strToReturn .= ' ' . $strChar;
                } // If a letter, and the previous character is a digit
                else {
                    if ((ord(strtolower($strChar)) >= ord('a')) &&
                        (ord(strtolower($strChar)) <= ord('z')) &&
                        (ord($strPrevChar) >= ord('0')) &&
                        (ord($strPrevChar) <= ord('9'))
                    ) { // Add a space
                        $strToReturn .= ' ' . $strChar;
                    } // Otherwise
                    else { // Don't add a space
                        $strToReturn .= $strChar;
                    }
                }
            }
        }

        return $strToReturn;
    }
public static function wordsFromCamelCase($strName)
    {
        if (strlen($strName) == 0) {
            return '';
        }

        $strToReturn = QString::firstCharacter($strName);

        for ($intIndex = 1; $intIndex < strlen($strName); $intIndex++) {
            // Get the current character we're examining
            $strChar = substr($strName, $intIndex, 1);

            // Get the character previous to this
            $strPrevChar = substr($strName, $intIndex - 1, 1);

            // If an upper case letter
            if ((ord($strChar) >= ord('A')) &&
                (ord($strChar) <= ord('Z'))
            ) { // Add a Space
                $strToReturn .= ' ' . $strChar;
            } // If a digit, and the previous character is NOT a digit
            else {
                if ((ord($strChar) >= ord('0')) &&
                    (ord($strChar) <= ord('9')) &&
                    ((ord($strPrevChar) < ord('0')) ||
                        (ord($strPrevChar) > ord('9')))
                ) { // Add a space
                    $strToReturn .= ' ' . $strChar;
                } // If a letter, and the previous character is a digit
                else {
                    if ((ord(strtolower($strChar)) >= ord('a')) &&
                        (ord(strtolower($strChar)) <= ord('z')) &&
                        (ord($strPrevChar) >= ord('0')) &&
                        (ord($strPrevChar) <= ord('9'))
                    ) { // Add a space
                        $strToReturn .= ' ' . $strChar;
                    } // Otherwise
                    else { // Don't add a space
                        $strToReturn .= $strChar;
                    }
                }
            }
        }

        return $strToReturn;
    }
public static function wordsFromCamelCase ( $ strName ) { if ( strlen ( $ strName ) == 0 ) { return '' ; } $ strToReturn = QString :: firstCharacter ( $ strName ) ; for ( $ intIndex = 1 ; $ intIndex < strlen ( $ strName ) ; $ intIndex ++ ) { // Get the current character we're examining $ strChar = substr ( $ strName , $ intIndex , 1 ) ; // Get the character previous to this $ strPrevChar = substr ( $ strName , $ intIndex - 1 , 1 ) ; // If an upper case letter if ( ( ord ( $ strChar ) >= ord ( 'A' ) ) && ( ord ( $ strChar ) <= ord ( 'Z' ) ) ) { // Add a Space $ strToReturn .= ' ' . $ strChar ; } // If a digit, and the previous character is NOT a digit else { if ( ( ord ( $ strChar ) >= ord ( '0' ) ) && ( ord ( $ strChar ) <= ord ( '9' ) ) && ( ( ord ( $ strPrevChar ) < ord ( '0' ) ) || ( ord ( $ strPrevChar ) > ord ( '9' ) ) ) ) { // Add a space $ strToReturn .= ' ' . $ strChar ; } // If a letter, and the previous character is a digit else { if ( ( ord ( strtolower ( $ strChar ) ) >= ord ( 'a' ) ) && ( ord ( strtolower ( $ strChar ) ) <= ord ( 'z' ) ) && ( ord ( $ strPrevChar ) >= ord ( '0' ) ) && ( ord ( $ strPrevChar ) <= ord ( '9' ) ) ) { // Add a space $ strToReturn .= ' ' . $ strChar ; } // Otherwise else { // Don't add a space $ strToReturn .= $ strChar ; } } } } return $ strToReturn ; }
Converts a CamelCased word into separate words

@param string $strName String to be converted

@return string Resulting set of words derived from camel case
@was QConvertNotation::WordsFromCamelCase
Converts a CamelCased word into separate words