Hi everybody! sorry i guess the title is not pretty accurate about what i am gonna ask but that's the best title i could come up with : )
i have database with 1000 topics for instance and all i want is when someone submit new one ... the script place <a> tags around any keyword in this submitted text and keywords will be taken from database (topics titles)
let's say there is this text:
Eset Smart Security was rated as the best choice by Cnet editors
and there is a title in the database like this "Eset Smart Security"
so what the code does is search and replace all keywords in the submitted text that match one of the topics titles
well this could be done by any search and replace function like str_replace or ereg_replace or whatever
but when i thought about it! it would not be really wise to loop through the text 1000 times (each for one of the titles).
this will cause lots of load on the CPU .. but i could not really think of something better to do this without worrying about the CPU load.
waiting for your reply thanks in advance