<?php
$string = 'foo-bar-baz';
$string = preg_replace_callback(
           '#(?<=-)(.)#',
           create_function(
               '$matches',
               'return strtoupper($matches[1]);'
           ),
           $string
       );
echo "$string\n";
?>