fork(9) download
  1. <?php
  2. $string = 'this-is_a-test';
  3.  
  4. function toUpper($matches) {
  5. return strtoupper($matches[1]);
  6. }
  7.  
  8. echo preg_replace_callback('/[-_](.)/', 'toUpper', $string);
  9. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
thisIsATest