title: how to replace all special characters except underscore and period in php?
body: <p>Can any one please show me how i can replace all special characters in a string except the underscore and the period symbols.And also I've been trying to understand how to make this replace patterns reading the <code>PHP</code> manual and its so confusing for a beginner like me so is there any other documentation or tutorial that is made easy for beginners so that i don't have to post another question like this and trouble you people every time i want to use this function?</p>
  
  <pre><code>preg_replace('/[^a-zA-Z0-9]/', '', $string);
  </code></pre>
  
  <p>this is what i have it replaces all the special characters but i want to except <code>_</code> and  <code>.</code>.</p>