$keywords = "machinery safety,European Directive,CE Marking"; ensure no spaces in before and after comma. Seperate keywords by commas
$array = explode(",", $keywords);
print_r($array);
foreach ($array as &$value) {
$replacementText = ' <a href="'.$value.'">'.$value.'</a>';
The only thing here is, I can see the 3 keywords that we are looking to replace - "machinery safety,European Directive,CE Marking"
But their replacements, I only see -
$replacementText = ’ <a href="’.$value.’">’.$value.’</a>’;
Is this just saying ’place a href link and use that keyword’
Can’t we specify an exact href link, as certain keywords will be hyperlinked to a page that isn’t necesarily based around that keyword. For example, I might want to specify the keyword ’michael jackson’ and hyperlink it to the ’www.exanple.com/80s-soul-music
Another issue I found is it is not searching for an exact match. It placed a hyperlin on the keyword ’bet’ within a sentence that used the plural, so looked like this get you free
bets here!!