$string = 'my_function'; $camelCaseString = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToLowerCamelCase($string); echo $camelCaseString; // Output: myFunction
$someArray = array( 'first_name' => 'John', 'last_name' => 'Doe' ); $newArray = array(); foreach ($someArray as $key => $value) { $newKey = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToLowerCamelCase($key); $newValue = $value; $newArray[$newKey] = $newValue; } print_r($newArray);This code converts the keys of an array from underscored format to camel case format using the underscoredToLowerCamelCase function. Package Library: TYPO3\CMS\Core\Utility