I have an issue, I am using str_replace with a array of values to find and replace. However, each replacement turns 1 characters into multiple characters and the multiple characters happen to have characters that end up being replaced again, over and over. Its hard to explain it so heres an example;
echo str_replace(array(']',':','/'),array('[:left_bracket:]','[:colon:]','[:forward_slash:]'),'T]es/t');
// Produces
// T[[:colon:]left_bracket[:colon:]]es[:forward_slash:]t
// When I want
// T[:left_bracket:]es[:forward_slash:]t
That is a simplified version, basically I am using a bigger table converting all characters that have MySQL regular expression escape character equivalents and the replacements on replacements are happening even more then that because of how many characters are being replaced. Reordering the replacements won't help either. Anyone have a suggestion on how to do the replacements on the original value, not having replacements put replacements on each other?
Thanks