fork download
  1. $regexp2,
  2. function ($result) {
  3. return "$result[1] " . mb_strtoupper($result[2]);
  4. },
  5. $res1
  6. );
  7.  
  8. $res2 = mb_strtoupper(mb_substr($res2, 0, 1)) . mb_substr($res2, 1);
Success #stdin #stdout 0.02s 24400KB
stdin
Standard input is empty
stdout
$res2 = preg_replace_callback(
    $regexp2,
    function ($result) {
        return "$result[1] " . mb_strtoupper($result[2]);
    },
    $res1
);

$res2 = mb_strtoupper(mb_substr($res2, 0, 1)) . mb_substr($res2, 1);