phpFlash标签云(flashtagcloud)的实现代码
时间:2021-07-01 10:21:17
帮助过:17人阅读
- require("config.php");
- require_once 'Tags.php';
- $sql = "SELECT tags FROM demo"; //在这里你可以随机或者限制一下取出的个数.
- $rs = $db->query($sql);
- while ($tags = $db->fetch_array($rs)) {
- $arr[] = split("\|",iconv("gb2312","utf-8",$tags['tags']));
- }
- $tags = new Tags($arr);
- $tagsArr = $tags->getTags();
- $tagsStr = '';
- foreach ($tagsArr as $value){
- $tagsStr .= urlencode(''.$value.'');
- }
- $tagsStr .= '
'; - ?>
js代码部分:
|