title: Find characters in string that are present in an array and remove them - php
body: <p>Let's say i have the following string: <code>$test ='abcd.gdda&lt;fsa&gt;dr'</code>;</p>
  
  <p>And the following array: <code>$array = array('&lt;','.');</code></p>
  
  <p>How can i find the positions of the characters that are elements in the $array array?
  (fastest way possible) and then store and remove them (without leaving NULL values at that specific index)?</p>
  
  <p>Ps. I know that i could use strpos() to check for each element but that would output something like: 9, 5 because the '&lt;' symbol is searched for before the '.' element and that causes the function to believe that the '&lt;' is before '.' in the string. I tried combining this with the sort() function...but i does not work as expected... (it outputs some NULL positions...)</p>