I have a database field that will include a small paragraph of information. Within that paragraph I'd like to give a specific word or phrase a hyperlink.
1) Create a secondary database that includes all keywords/phrases in one field, and the associated URL in a second field.
3) Read a target text element into a string
4) Iterate through the array and replace any instances of target keyword/phrase with a new string that adds the associated hyperlink to the word
5) Update text element to include the new string with new format
6) Loop to repeat this process for each text element
*Please feel free to suggest any improvements / alternate methods
What's the best way to do steps 2 and 3?
Can steps 3-5 be condensed?
Whatever solution I end up implementing should not noticeably affect page load times.