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)29401[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 yesterday

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

35

—

LowBetter than 77% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

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

504d 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

[ip2location/ip2location-laravel

Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.

82548.8k1](/packages/ip2location-ip2location-laravel)[michalmanko/php-library-holiday

A library to calculate holidays

2182.4k1](/packages/michalmanko-php-library-holiday)[typo3/cms-introduction

The Official TYPO3 Introduction Package

1882.7k6](/packages/typo3-cms-introduction)[alt-design/alt-sitemap

Alt Sitemap addon, create a sitemap from Statamic entries

1223.5k](/packages/alt-design-alt-sitemap)

PHPackages © 2026

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