Jump to content

Failing at using Explode; help?


Cultureshock

Recommended Posts

I have a table that holds info. One column in particular holds tags(

while(mysql_fetch_array($example)){aka $tags=['tags']};

) which are separated by commas (ex. $tags= love, hate, like, dislike). I want to turn this string into an array to link each seperated word into links

<a href="?tag=love">love</a> <a href="?tag=hate">hate</a> etc

I thought doing

while(explode(",", $tags)){ echo "<a href='?tag=".$tag."'>".$tag."</a>";};

would work but instead it takes the page a long time to load, and once it DOES load, the first tag is repeated 100s of times.

 

 

Assistance, please :) I don't know if the problem is in the while(explode()) or if it's in something else related to the $tags, but everything else not exploded is working correctly, soo.

Link to comment
https://forums.phpfreaks.com/topic/187619-failing-at-using-explode-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.