Hello,
I have a news site containing an archive with more than 1 million news. I created a word definitions database with about 3000 entries, consisting of word-definition pairs.
What I want to do is adding a definition next to every occurence of these words in the news. I cant make a static change as I can add a new keyword everyday, so i can make it realtime or cached.
The question is, a str_replace or a preg_replace would be very slow for searching 3 thousand keywords in a text and replacing them.
Are there any fast alternatives?