PHPackages                             cal7/trie - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cal7/trie

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cal7/trie
=========

A package to facilitate usage of the TRIE data structure

17PHP

Since Jan 31Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Cal7/php-trie)[ Packagist](https://packagist.org/packages/cal7/trie)[ RSS](/packages/cal7-trie/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

php-trie
========

[](#php-trie)

A PHP package to facilitate usage of the trie data structure.

Allows the insertion and lookup of words, generation from a text file, and a search feature for Scrabble-like games

Word insertion
--------------

[](#word-insertion)

Word insertion is as easy as:

```
$trie = new Trie();
$trie->addWord("example");
```

Or if you have a text file containing a list of words (each on a newline), either locally or online, you can use:

```
$trie1 = Trie::fromTextFile("/local/path/to/file.txt");
$trie2 = Trie::fromTextFile("https://example.com/file.txt");
```

Word finding
------------

[](#word-finding)

This package offers a feature useful for many Scrabble-related applications - word finding. The following snippet showcases this:

```
$trie = new Trie();
$trie->addWords([
  "example",
  "test",
  "tested",
  "testing"
]);
$letters = ["t", "e", "s", "t"];
$wildcardCount = 2; //represents a "blank" tile in the game of Scrabble
$trie->findWords($letters, $wildcardCount); //returns ["test", "tested"]
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12816198?v=4)[Cal7](/maintainers/Cal7)[@Cal7](https://github.com/Cal7)

---

Top Contributors

[![Cal7](https://avatars.githubusercontent.com/u/12816198?v=4)](https://github.com/Cal7 "Cal7 (23 commits)")

### Embed Badge

![Health badge](/badges/cal7-trie/health.svg)

```
[![Health](https://phpackages.com/badges/cal7-trie/health.svg)](https://phpackages.com/packages/cal7-trie)
```

###  Alternatives

[altis/local-server

Local Server module for Altis

18221.6k3](/packages/altis-local-server)

PHPackages © 2026

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