title: Ignore specific character: -
body: <p>I want to ignore a specific character using php. So when a user adds this character in the textbox. the php scripts filters it out first. I tried something and came up with this:</p>
  
  <pre><code>&lt;?php
      $datetogoto = $_GET['datetogoto'];
      $pattern = '-';
      $replace = '';
      preg_replace($pattern, $replace, $datetogoto);
      header('Location: ../index.php?newsdate='.$datetogoto);
  ?&gt;
  </code></pre>
  
  <p>So what it wrong with this code?</p>