/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
{ $spread = $maximumCount - $minimumCount; $cloudHTML = ''; $spread == 0 && $spread = 1; foreach( $data as $tag => $count ) { $size = $minFontSize + ( $count - $minimumCount ) * ( $maxFontSize - $minFontSize ) / $spread; . '" class="tag_cloud" href="#" title="\'' . $tag . '\' returned a count of ' . $count . '">' } } /************************** **** Sample usage ***/ 'Blur' => 18, 'Canvas' => 33, 'Class' => 15, 'Color Palette' => 11, 'Crop' => 42, 'Delimiter' => 13, 'Depth' => 34, 'Design' => 8, 'Encode' => 12, 'Encryption' => 30, 'Extract' => 28, 'Filters' => 42); echo getCloud($arr, 12, 36);