<style>
a.LinkNormal:link { color: #0099FF; text-decoration: none }
a.LinkNormal:visited { color: #0099FF; text-decoration: none }
a.LinkNormal:active { color: #0099FF; text-decoration: none }
a.LinkNormal:hover { color: #33FFFF; text-decoration: none }
</style>


<?php
function printTagCloud($tags,$url,$css) {
        
        
$max_size 32//กำหนด ขนาด font ใหญ่ สุดที่นี่
        
$min_size 12// กำหนด ขนาด font เล็ก สุดที่นี่
       
        
ksort($tags);
        
$max_qty max(array_values($tags));
        
$min_qty min(array_values($tags));
       
        
$spread $max_qty $min_qty;
        if (
$spread == 0) {
                
$spread 1;
        }
       
        
$step = ($max_size $min_size) / ($spread);
       
        foreach (
$tags as $key => $value) {
                
$size round($min_size + (($value $min_qty) * $step));
       
                
$printTagCloud .=  '<a href="'.$url$key.'" style="font-size: ' $size 'px" title="' $value ' things tagged with ' $key '" class="'.$css.'">' $key '</a> ';
        }

        return 
$printTagCloud ;
}



### Example ###
$tags = array('PHP' => 32'Google' => 431'ASP.NET' => 622'JAVA' => 51'WEB 2.0' => 23'Linux' => 971'Firefox' => 407'Idea' => 82'Music' => 227);
$url="http://www.memo8.com/toolkits/?s=";
$css="LinkNormal";

echo 
printTagCloud($tags,$url,$css);

?>