fork(3) download
  1. <?php
  2.  
  3. $s = "This is my text.";
  4. echo preg_replace('~(?<=\s)\s~', '&nbsp;', $s);
  5.  
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
This is &nbsp;&nbsp;&nbsp;&nbsp;my text.