fork download
  1. <?php
  2.  
  3. $s = "()-#\\*|Text/";
  4. $arr = [ '-', '(', ')', '*', '|', '/', '\\', '#'];
  5. $result = str_replace($arr, '', $s);
  6. echo $result;
  7. $res = preg_replace('~[- ()*|/\\\\#]~', '', $s);
  8. echo "\n" . $res;
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Text
Text