I have a string: 'Some_string_to_capitalize' which I would like to transform to 'Some_String_To_Capitalize'. I have tried:
$result = preg_replace( '/(_([a-z]{1}))/' , strtoupper('$1') , $subject )
and
$result = preg_replace( '/(_([a-z]{1}))/' , "strtoupper($1)" , $subject )
I looked at the php man page and here on SO but found nothing. Apologies if this is a dup!