fork(4) download
  1. <?php
  2.  
  3. $string = 'MyHomeIsHere';
  4. $regex = '~ # delimiters
  5. \B # match where \b does not match
  6. [A-Z] # one of A-Z
  7. ~x'; # free spacing mode for this explanation
  8.  
  9. $words = preg_replace($regex, ' $0', $string);
  10. echo $words;
  11. ?>
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
My Home Is Here