fork download
  1. <?php
  2. $str = 'Henry J Doe';
  3. $repl = preg_replace('/([A-Z])(?=\s|$)/', '\1.', $str);
  4. echo $repl . "\n";
  5. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Henry J. Doe