public static function toCamelCase($name = '', $replace = '_', $capitalize_first_char = true)
    {
        if (empty($name)) {
            return '';
        }
        if ($capitalize_first_char) {
            $name[0] = strtoupper($name[0]);
        }
        $func = create_function('$c', 'return strtoupper($c[1]);');
        return trim(preg_replace_callback('#'.$replace.'([a-z])#', $func, $name), $replace);
    }