“String php sublinhe no camelcase” Respostas de código

função php para converter string em camelcase

echo ucwords("hello world");
Faithful Fish

String php sublinhe no camelcase

function dashesToCamelCase($string, $capitalizeFirstCharacter = false) 
{

    $str = str_replace(' ', '', ucwords(str_replace('-', ' ', $string)));

    if (!$capitalizeFirstCharacter) {
        $str[0] = strtolower($str[0]);
    }

    return $str;
}

echo dashesToCamelCase('this-is-a-string');
Blue-eyed Bat

Respostas semelhantes a “String php sublinhe no camelcase”

Perguntas semelhantes a “String php sublinhe no camelcase”

Mais respostas relacionadas para “String php sublinhe no camelcase” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código