title: I want to remove special symbols, periods, hyphen, underscore & number from a string - PHP
body: <p>My requirement is to remove all special symbols except underscore from a string.</p>
  
  <p>I am using.. </p>
  
  <pre><code>$string = 'text-text_text+text@text(text)text&amp;text.text*text\text/text';
  $columnName = preg_replace('/[^a-zA-Z0-9_ %\[\]\.\(\)%&amp;-]/s', '_', $string);
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>text-text_text_text_text(text)text&amp;text.text_text_text_text
  </code></pre>
  
  <p>But its not removing periods, ampersand, brackets and dash. I felt like helpless while creating this regular expression. Please help..</p>