I am pretty new to PHP and hope someone here can help me with this:
I have a variable string that looks like the following, containing either nothing OR a series of words, separated with comma and space.
Example:
item1, item2, item3
What would be the best / fastest way to replace the single items in this string by adding an img tag with the same item name as the source + remove the commas ?
The above example should then look as follows:
item1 <img src="item1.png" alt="" /> item2 <img src="item2.png" alt="" /> item3 <img src="item3.png" alt="" />
Many thanks for any help with this, Mike.