I have a variable $keywords
The content of this variable are words separated by commas or spaces
for example:
$keywords= key1,key2,key3
Or
$keywords=key1 key2 key3
the table that I have is:
<table width="500" border="1">
<tr>
<td height='auto'>Keywords: $keywords</td>
</tr>
</table>
I want explode $keywords in key1 key2 key3 …
And associate to each separated word a predifined URL:
http://miosite.com/search/label/key1
http://miosite.com/search/label/key2
http://miosite.com/search/label/key3
So I want get this:
<table width="500" border="1">
<tr>
<td height='auto'>Keywords: key1,key2,key3</td>
</tr>
</table>
Where
key1=http://miosite.com/search/label/key1
key2=http://miosite.com/search/label/key2
key1=http://miosite.com/search/label/key3
How to?
You could check for the comma to determine which delimiter to explode on, then put together the string again:
EDIT: Apparently the object is to REMOVE the site address, not add it… no one figured that out. new code:
Hackish, but give that a shot.
Edit: Oh now they need to be linked? LOL
Ok, try that out.