Copy CodeThe code is as follows:
function Getcloud ($data = Array (), $minFontSize = A, $maxFontSize = 30)
{
$minimumCount = Min (array_values ($data));
$maximumCount = Max (Array_values ($data));
$spread = $maximumCount-$minimumCount;
$cloudHTML = ";
$cloudTags = Array ();
$spread = = 0 && $spread = 1;
foreach ($data as $tag = $count)
{
$size = $minFontSize + ($count-$minimumCount)
* ($maxFontSize-$minFontSize)/$spread;
$cloudTags [] = '. ' "href=" # "title=" \ ". $tag.
' \ ' returned a count of '. $count. ' > '
. Htmlspecialchars (Stripslashes ($tag)). '';
}
return join ("\ n", $cloudTags). "\ n";
}
/**************************
Sample usage ***/
$arr = Array (' Actionscript ' = +, ' Adobe ' = ' + ', ' array ' = +, ' Background ' = 43,
' Blur ' +, ' Canvas ' = +, ' Class ' = ', ' Color Palette ' and ' 42 ', ' Crop ',
' Delimiter ' and ' Depth ', ' Design ' = 8, ' Encode ', ' + ', ' encryption ' and ' = 30,
' Extract ', ' Filters ' and ' 42 ';
Echo Getcloud ($arr, 12, 36);
This is an article released before the home of the script. More tips can be used for reference.
21 useful and convenient PHP function codes collected
http://www.bkjia.com/PHPjc/321866.html www.bkjia.com true http://www.bkjia.com/PHPjc/321866.html techarticle Copy the code code as follows: function Getcloud ($data = Array (), $minFontSize = A, $maxFontSize =) {$minimumCount = min (array_val UEs ($data)); $maximumCount = max (Array_val ...