{
    分享网正式开通,我们为大家提供免费资源,欢迎大家踊跃投稿!

php制作漂亮的随机颜色标签云效果

之前做随机色标签云都是用JS写的,JS写就是有个问题,太消耗服务器了,每次刷新的颜色也都不一样。今天发现了用PHP制作随机色标签云的代码,分享给大家,学会了可以套用到各种地方。

效果图演示

PHP制作随机色标签云代码

<?
srand((float) microtime() * 10000000);
$input = array("8b90c4","ee96e","81fa17","f81","aab80a","de11a5","2d0705","c4de05","1b7ef7","84b6b2","2ca94b","3e383f","5d73c1","a317ad","4ffafa","696f3e","e7aa89","a5b575","19c9ed","70e46c","7d4fa","62caaa","d1f484","795a1a","daf143","581cba","c99bac","3a2fb4","f725dc","7722f0","d79bd3","82b6a0","860c5e","5995ea","82c622","30c469","37a78f","afcd27","f5a26e","532687","3483da","224bb9","915ec7","91f79b","c56367");
$rand_keys = array_rand($input, 2);
$input1 = array("8","13","12");
$rand_f = array_rand($input1, 2);
echo '<a target="_blank" href="#" style="color:#'.$input[$rand_keys[0]].';font-size: '.$input1[$rand_f[0]].'pt;;">'.$bqr['tagname'].'</a>';
 ?>

代码中的array里面的字符串就是各种随机色的编码,大家可以根据自己的需求来配置颜色。

然后input1里面是字体大小的随机代码,也可以自行修改。


资源均来自第三方,谨慎下载,前往第三方网站下载


米微资源分享网 , 版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php制作漂亮的随机颜色标签云效果
喜欢 ()分享 (0)