update page now

Voting

: max(seven, one)?
(Example: nine)

The Note You're Voting On

Alex Milkovskyi
10 years ago
Convert string to in camel-case, useful for class name patterns:
<?php
/**
   * Convert string to in camel-case, useful for class name patterns.
   *
   * @param $string
   *   Target string.
   *
   * @return string
   *   Camel-case string.
   */
function toCamelCase($string){
    $string = str_replace('-', ' ', $string);
    $string = str_replace('_', ' ', $string);
    $string = ucwords(strtolower($string));
    $string = str_replace(' ', '', $string);
    return $string;
}
?>

Example:
toCamelCase(make_mE camel-case pLEase) will return:
MakeMeCamelCasePlease

<< Back to user notes page

To Top