fork download
  1. <?php
  2. $string = 'The quick brown fox jumped over the lazy dog.';
  3. $patterns = array();
  4. $patterns[0] = '/quick/';
  5. $patterns[1] = '/brown/';
  6. $patterns[2] = '/fox/';
  7. $replacements = array();
  8. $replacements[2] = 'bear';
  9. $replacements[1] = 'black';
  10. $replacements[0] = 'slow';
  11. echo $replacements[0];
  12. echo $replacements[1];
  13. echo $replacements[2]
  14. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
slowblackbear