PHPackages                             writecrow/highlighter - 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. writecrow/highlighter

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

writecrow/highlighter
=====================

Highlights words/phrases per specified parameters

2.0.3(1y ago)38961[1 issues](https://github.com/writecrow/highlighter/issues)MITPHP

Since Sep 7Pushed 1y ago4 watchersCompare

[ Source](https://github.com/writecrow/highlighter)[ Packagist](https://packagist.org/packages/writecrow/highlighter)[ RSS](/packages/writecrow-highlighter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (11)Used By (0)

Excerpt Highlighter
===================

[](#excerpt-highlighter)

A PHP library for creating a highlighted excerpt a provided list of tokens in a provided text string.

Basic usage in an application
-----------------------------

[](#basic-usage-in-an-application)

The included `index.php` file contains a generation form demo.

Make your code aware of the Highlighter class via your favorite method (e.g., `use writecrow\Highlighter\HighlightExcerpt;`)

```
print HighlightExcerpt::highlight('Round the rugged rock,' ['the']);
// Will print 'Round the rugged rock'

print HighlightExcerpt::highlight('Round the rugged rock,' ['the', 'rock']);
// Will print 'Round the rugged rock'

print HighlightExcerpt::highlight('Round the rugged rock,' ['ro', '"round"']);
// Will print 'Round the rugged rock', since `ro` is present,
// but only a word partial,
// and `round` is present, but double-quotes indicate case-sensitivity
// so `round` != `Round`
```

Advanced behaviors
------------------

[](#advanced-behaviors)

The excerpt highlighter will:

- Default to case-insensitive highlighting for a word (e.g., `'the'`)
- Become case-sensitive if the token is wrapped in double quotes (e.g. `'"The"'`)
- Not highlight partial word matched (e.g., `'the'` will not highlight `therefore`)
- Given multiple tokens passed to be highlighted, will create shorter, concatenated excerpts from the text which overall try to honor the length parameter specified (see below)
- Produce excerpts that start/end on word boundaries

### Length

[](#length)

Pass a 3rd parameter, an integer, to the function to specify the desired length of the excerpt.

```
print HighlightExcerpt::highlight('Round the rugged rock,' ['the'], 300);
// Would limit the excerpt to 300 characters
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

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

Every ~220 days

Recently: every ~209 days

Total

10

Last Release

459d ago

Major Versions

1.2.2 → 2.0.02022-10-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4305692?v=4)[Mark Fullmer](/maintainers/markfullmer)[@markfullmer](https://github.com/markfullmer)

![](https://avatars.githubusercontent.com/u/27739911?v=4)[Corpus &amp; Repository of Writing (Crow)](/maintainers/writecrow)[@writecrow](https://github.com/writecrow)

---

Top Contributors

[![markfullmer](https://avatars.githubusercontent.com/u/4305692?v=4)](https://github.com/markfullmer "markfullmer (35 commits)")[![jmf3658](https://avatars.githubusercontent.com/u/34824280?v=4)](https://github.com/jmf3658 "jmf3658 (2 commits)")

---

Tags

highlightnatural-language-processingphp-library

### Embed Badge

![Health badge](/badges/writecrow-highlighter/health.svg)

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

###  Alternatives

[unclecheese/display-logic

Allows assignment of conditions for display and hide of specific form fields based on client side behavior.

771.0M101](/packages/unclecheese-display-logic)[pubsubhubbub/subscriber

pubsubhubbub implementation of subscriber.

32100.2k](/packages/pubsubhubbub-subscriber)[humanmade/hm-content-import

Migration framework for WordPress

2931.6k1](/packages/humanmade-hm-content-import)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[spaggel/tooltip

Product attribute tooltips module for Magento 2

2431.5k](/packages/spaggel-tooltip)[slicksky/spam-blacklist-query

Find out if a domain or IP is blacklisted on the most popular spam listing services.

1131.8k](/packages/slicksky-spam-blacklist-query)

PHPackages © 2026

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