Let's say i have the following string: $test ='abcd.gdda<fsa>dr'
;
And the following array: $array = array('<','.');
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)?
Ps. I know that i could use strpos() to check for each element but that would output something like: 9, 5 because the '<' symbol is searched for before the '.' element and that causes the function to believe that the '<' 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...)