<?php
//参数1,正则表达式
//参数2,匿名回调函数
//参数3,匹配的字符串
echo preg_replace_callback(
    '~-([a-z])~',
    function ($match){return strtoupper($match[1]);},
    '-hello-world'
);