Forum Moderators: coopster
Right now I extract all the words from my article and check to see if I find any of those words in my foods table. But I bet there's a better approach to this, especially since this approach does not work with expressions with multiple words.
I've seen this system work in my browser, when I had some viruses, but can't manage to find the solution when I need it.
Any ideas?
This is a bit awkward since you need to put the whole link in the replacement array. However, it uses str_replace, so it's easy to understand.
You could use regular expressions to do this more efficiently if the protein name is always in a predictable part of the url of the site - but this gets a lot more complicated, and you might not be up for that.