fork(10) download
  1. <?php
  2. $regex = '~"[^"]*"(*SKIP)(*F)|\s+~';
  3. $subject = 'hola hola "pepsi cola" yay';
  4. $replaced = preg_replace($regex,"",$subject);
  5. echo $replaced."<br />\n";
  6. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
holahola"pepsi cola"yay<br />