Welcome to WebmasterWorld Guest from 220.127.116.11
I've got problem which I've so nearly solved but I have a couple issues.
What's happening, is that it displays the news item twice because there are 2 keywords in the DB, so I'm trying to resolve that, I think that might be the problem?
Then when it displays the article first time round it then places links on the first keyword in the DB. And then when it displays the article second time round it places links according to the second keyword in the DB, but not the first keyword in the DB as well.
So it might be something to do the with the looping?
Any ideas anyone?
Here's the code:
for ($x=0;$x < count($bits);$x++)
for ($y=0;$y < count($final_words);$y++)
$test.=' '."<a href=\"$DBurl\">".$DBkeyword."</a>" .' ';
$test.=' '.$final_words[$y].' ';
Okay, I've got it to work...
Here's the code, just in case anyone whose interested. Just to re-iterate, this places links on the fly according to what keywords you have in the DB.
If anyone has any comments, then feel free to post.
$replace_string = "<u><a href=\"$DBurl\">$DBkeyword</a></u>";
$DBmain_story = str_replace(' ' . $DBkeyword. ' ', ' ' . $replace_string . ' ', $DBmain_story);