3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function underscoreToCamelCase( $string, $first_char_caps = false) { if( $first_char_caps == true ) { $string[0] = strtoupper($string[0]); } $func = create_function('$c', 'return strtoupper($c[1]);'); return preg_replace_callback('/_([a-z])/', $func, $string); } echo underscoreToCamelCase('valami_underscored_cucc');
Output for 4.3.0 - 7.1.0
valamiUnderscoredCucc