$stepvalue = !$stepvalue?1:$stepvalue;

Couldn't your approach of storing ALL tags in a php array get too heavy with massive amounts of tags? Same with using LIKE in your SQL...

Great site and fontsmack rocks!

Gaurav said on November 26, 2005

Gr8 site and tutorial.

You can also make the list as Alphabetical Weighted List. Just need to add one line.

$typecount = array_count_values($types);
$types = array_unique_compact($types);


said on February 17, 2006

this is awesoemf

adam said on February 28, 2006

you are the best web site in the worild

Richard said on May 31, 2006

I was about to throw my computer out the window!

Aamir Mahmood said on September 06, 2006

I always like your code, i added your tags code in a client's website, and now he asked me to do same like blogmarks.net and i was searching and searching and came again to your post and it worked

Thank Buddy

jack said on January 05, 2007

This is cool! I am going to implement it on my site real soon.


amin said on January 09, 2007

Interesting...but i'm using PHP4.3 and couldn't get the function name array_unique_compact.....I'm newbie in PHP. Could suggest any action can i take for this problem..

Marc said on February 01, 2007

good solution. i realised my tagcloud in a similar way:


amin2u said on February 04, 2007

ok now i'm done with this weighting tags...i'm having a problem where i want to pull all the related tag. Let's say user pick a tag named malaysia. There are also related tag such as kuala lumpur, kedah, melaka, and so on. I hope that someone could give me the idea on how to do this

Jack said on March 31, 2007

I really like this idea, really quite original!

Gabe said on May 25, 2007

Are you pulling all the tags out of the mySQL table? You really should use "GROUP BY" and "COUNT()" so that you don't pull duplicate tags from the mySQL table as well as weigh the tags.

Manuel said on July 30, 2007

Cool, I will try to get this working on my site.

J said on September 09, 2007

//Weight for tag re-occurance
$tagcount = array_reverse($tagcount);
$tags = array_keys($tagcount);


Mac Millan said on September 10, 2007

couldn't get the function name array_unique_compact either, any help?

Jonathan Dingman said on September 12, 2007

Wow, Jonathan, you've done a great job with this. It is a very straight forward tutorial and is easy to use, thank you.

Definitely bookmarking this site for future updates, you are a great writer.

thanks again so much Jonathan.

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.