fork download
  1. <?php
  2. $string = 'PrintHelloWorld';
  3. $pattern = '/(?<!^)([A-Z])/';
  4. $replacement = '_$1';
  5. echo preg_replace($pattern, $replacement, $string);
  6. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Print_Hello_World