fork download
  1. <?php
  2.  
  3. $phrase = "You should eat fruits, vegetables, and fiber every day.";
  4. $patterns = array("/fru+its/", "/vegeta+bles/", "/fi+be+r/");
  5. $yummy = array("pizza", "beer", "ice cream");
  6. $newphrase = preg_replace($patterns, $yummy, $phrase);
  7.  
  8. print($newphrase);
  9.  
  10. ?>
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
You should eat pizza, beer, and ice cream every day.