PHPackages                             lotsofcode/tag-cloud - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lotsofcode/tag-cloud

ActiveLibrary

lotsofcode/tag-cloud
====================

PHP tag cloud class http://lotsofcode.github.com/tag-cloud

4.0.1(11y ago)564.1k19[1 issues](https://github.com/lotsofcode/tag-cloud/issues)PHP

Since Aug 5Pushed 9y ago7 watchersCompare

[ Source](https://github.com/lotsofcode/tag-cloud)[ Packagist](https://packagist.org/packages/lotsofcode/tag-cloud)[ RSS](/packages/lotsofcode-tag-cloud/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHP Tag Cloud
=============

[](#php-tag-cloud)

v4.0.1
------

[](#v401)

[![Build Status](https://camo.githubusercontent.com/be1cababc99905851c0972775b201cdaa009f2ad30294d48abf5073879975595/68747470733a2f2f7472617669732d63692e6f72672f6c6f74736f66636f64652f7461672d636c6f75642e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/lotsofcode/tag-cloud)

#### Install with composer

[](#install-with-composer)

```
composer require lotsofcode/tag-cloud
```

#### Basic usage

[](#basic-usage)

```
$cloud = new TagCloud();
$cloud->addTag("tag-cloud");
$cloud->addTag("programming");
echo $cloud->render();
```

#### Convert a string

[](#convert-a-string)

```
$cloud->addString("This is a tag-cloud script, written by Del Harvey. I wrote this tag-cloud class because I just love writing code.");
```

#### Adding multiple tags

[](#adding-multiple-tags)

```
$cloud->addTags(array('tag-cloud','php','github'));
```

#### Removing a tag

[](#removing-a-tag)

```
$cloud->setRemoveTag('github');
```

#### Removing multiple tags

[](#removing-multiple-tags)

```
$cloud->setRemoveTags(array('del','harvey'));
```

#### More complex adding

[](#more-complex-adding)

```
$cloud->addTag(array('tag' => 'php', 'url' => 'http://www.php.net', 'colour' => 1));
$cloud->addTag(array('tag' => 'ajax', 'url' => 'http://www.php.net', 'colour' => 2));
$cloud->addTag(array('tag' => 'css', 'url' => 'http://www.php.net', 'colour' => 3));
```

#### Set the minimum length required

[](#set-the-minimum-length-required)

```
$cloud->setMinLength(3);
```

#### Limiting the output

[](#limiting-the-output)

```
$cloud->setLimit(10);
```

#### Set the order

[](#set-the-order)

```
$cloud->setOrder('colour','DESC');
```

#### Set a custom HTML output

[](#set-a-custom-html-output)

```
$cloud->setHtmlizeTagFunction(function($tag, $size) use ($baseUrl) {
  $link = ''.$tag['tag'].'';
  return "{$link} ";
});
```

#### Outputting the cloud (shown above)

[](#outputting-the-cloud-shown-above)

```
echo $cloud->render();
```

#### Transliteration

[](#transliteration)

By default, all accented characters will be converted into their non-accented equivalent, this is to circumvent duplicate similar tags in the same cloud, to disable this functionality and display the UTF-8 characters you can do the following:

```
$tagCloud->setOption('transliterate', false);
```

More usages on in a prettier format can be found here:

Tests
-----

[](#tests)

To run the unit test suite, first install the dependencies:

```
curl -s https://getcomposer.org/installer | php
php composer.phar install
```

Then execute phpunit in the root directory

```
./vendor/bin/phpunit
```

Submitting pull requests
------------------------

[](#submitting-pull-requests)

Indentation style, size and encoding should be followed as per .editorconfig settings.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5613e6c85beabef6d27e216bb5ef1b19089a78d734108510e5513ca0fef8d89?d=identicon)[coldwinds](/maintainers/coldwinds)

---

Top Contributors

[![lotsofcode](https://avatars.githubusercontent.com/u/682679?v=4)](https://github.com/lotsofcode "lotsofcode (35 commits)")[![kronn](https://avatars.githubusercontent.com/u/72198?v=4)](https://github.com/kronn "kronn (7 commits)")[![coldwinds](https://avatars.githubusercontent.com/u/961027?v=4)](https://github.com/coldwinds "coldwinds (2 commits)")[![cgoosey1](https://avatars.githubusercontent.com/u/4975833?v=4)](https://github.com/cgoosey1 "cgoosey1 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lotsofcode-tag-cloud/health.svg)

```
[![Health](https://phpackages.com/badges/lotsofcode-tag-cloud/health.svg)](https://phpackages.com/packages/lotsofcode-tag-cloud)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
