Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #string #underscore #camelcase
ADD COMMENT
Topic
Name
5+1 =