I have a string like this:
$d = 'game, story, animation, video';
And I want to change it to a result like this:
<a href="game">game</a>, <a href="story">story</a>, <a href="animation">animation</a>, <a href="video">video</a>
So I think I have to split $d by ',' then use a for
loop.
I have tried this:
$d = 'game, story, animation, video';
list($a, $b, $c, $d) = explode(" ,", $d);
But how do I split it if I don't know how many ',' are going to be there, and reach the desired result?