时间:2021-07-01 10:21:17 帮助过:14人阅读
|
本文介绍下,php实现云标签的一个简单例子,老外写的,很简炼。有需要的朋友,可以参考下人家的写法。
php 云标签的例子,代码如下:
$value) {
// calculate font-size
// find the $value in excess of $min_qty
// multiply by the font-size increment ($size)
// and add the $min_size set above
$size = round($min_size + (($value - $min_qty) * $step));
echo '' . $key . ' ';
}
}
//调用示例
$tags = array('weddings' => 32, 'birthdays' => 41, 'landscapes' => 62, 'ham' => 51, 'chicken' => 23, 'food' => 91, 'turkey' => 47,
'windows' => 82, 'apple' => 27);
printTagCloud($tags);
?> |