Home  >  Article  >  Backend Development  >  php Flash tag cloud (flash tagcloud) implementation code

php Flash tag cloud (flash tagcloud) implementation code

WBOY
WBOYOriginal
2016-07-25 08:56:52930browse
  1. require("config.php");
  2. require_once 'Tags.php';
  3. $sql = "SELECT tags FROM demo"; //Here you can randomize or limit the taken out Number.
  4. $rs = $db->query($sql);
  5. while ($tags = $db->fetch_array($rs)) {
  6. $arr[] = split("|",iconv( "gb2312","utf-8",$tags['tags']));
  7. }
  8. $tags = new Tags($arr);
  9. $tagsArr = $tags->getTags();
  10. $tagsStr = '';
  11. foreach ($tagsArr as $value){
  12. $tagsStr .= urlencode(''.$value.'');
  13. }
  14. $tagsStr .= '';
  15. ? >
Copy code

js code part:

Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn