- preg_replace_callback: documentation ( source)
- ucfirst: documentation ( source)
<?php
function _convertToCamelCase(array $matches)
{
return ucfirst($matches[1]);
}
$key = 'valami_underscored_cucc';
echo preg_replace_callback(
'/_(\w)/',
array($this, '_convertToCamelCase'),
$key);