- preg_replace_callback: documentation ( source)
- ucfirst: documentation ( source)
<?php
$key = 'me_ApetEce_comer_algo_jajjajaj';
//$key = strtolower($key);
$key = preg_replace_callback('/_([a-z])/', function(array $matches) { return ucfirst($matches[1]);}, $key);
echo $key;