Answers for "string dash to camelcase php"

PHP
2

php function to convert string to camelcase

echo ucwords("hello world");
Posted by: Guest on May-15-2020
1

php string underscore into 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');
Posted by: Guest on June-11-2020

Browse Popular Code Answers by Language