i am trying to 'clean' my products names from something like 'blackberry Z3 64GB black' to 'blackberry Z3' I have an array of words and i use str_ireplace to remove them. The problem occurs is that when i remove the word 'black' it is also removed from the blackberry. I need to remove the word ONLY if it is a word and not part of another word. Maybe regex?
Any suggestions?