public static function fromCamelCase($input, $grouped = false)
    {
        return $grouped
            ? preg_split('/(?<=[^A-Z_])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][^A-Z_])/x', $input)
            : trim(preg_replace('#([A-Z])#', ' $1', $input));
    }
public static function fromCamelCase($input, $grouped = false)
    {
        return $grouped
            ? preg_split('/(?<=[^A-Z_])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][^A-Z_])/x', $input)
            : trim(preg_replace('#([A-Z])#', ' $1', $input));
    }
public static function fromCamelCase ( $ input , $ grouped = false ) { return $ grouped ? preg_split ( '/(?<=[^A-Z_])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][^A-Z_])/x' , $ input ) : trim ( preg_replace ( '#([A-Z])#' , ' $1' , $ input ) ) ; }
Method to convert a string from camel case.

This method offers two modes. Grouped allows for splitting on groups of uppercase characters as follows:

"FooBarABCDef"            becomes  array("Foo", "Bar", "ABC", "Def")
"JFooBar"                 becomes  array("J", "Foo", "Bar")
"J001FooBar002"           becomes  array("J001", "Foo", "Bar002")
"abcDef"                  becomes  array("abc", "Def")
"abc_defGhi_Jkl"          becomes  array("abc_def", "Ghi_Jkl")
"ThisIsA_NASAAstronaut"   becomes  array("This", "Is", "A_NASA", "Astronaut"))
"JohnFitzgerald_Kennedy"  becomes  array("John", "Fitzgerald_Kennedy"))

Non-grouped will split strings at each uppercase character.

@param   string  $input   The string input (ASCII only).
@param   boolean $grouped Optionally allows splitting on groups of uppercase characters.

@return  string  The space separated string.

@since   2.0
Method to convert a string from camel case .