fork download
  1. <?php
  2.  
  3. $string = "This is an example string that we will replace";
  4. $new_string = regex($string);
  5. echo $new_string;
  6.  
  7. function regex($text) {
  8. $array = array('#ex.*ple#', '#a[nt]#');
  9. $text = preg_replace($array, '', $text);
  10. return $text;
  11. }
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
This is   string th we will replace