PHPackages                             richarddobron/highlight-lite - 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. [Search &amp; Filtering](/categories/search)
4. /
5. richarddobron/highlight-lite

ActiveLibrary[Search &amp; Filtering](/categories/search)

richarddobron/highlight-lite
============================

Lightweight PHP library designed to highlight search terms in text.

0.1.3(5mo ago)015.8k↑369.4%MITPHPPHP ^7.4 || ^8.0CI passing

Since Feb 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/richardDobron/highlight-lite)[ Packagist](https://packagist.org/packages/richarddobron/highlight-lite)[ RSS](/packages/richarddobron-highlight-lite/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

 [![HIGHLIGHT your search](./logo/logo.svg)](./logo/logo.svg)Lightweight PHP library designed to highlight search terms in text.

📖 Requirements
--------------

[](#-requirements)

- PHP 7.4 or higher
- [Composer](https://getcomposer.org) is required for installation
- PHP Extensions: `ext-mbstring`

📦 Installation
--------------

[](#-installation)

Install the library using Composer:

```
$ composer require richarddobron/highlight-lite
```

⚡️ Quick Start
--------------

[](#️-quick-start)

Here’s how to use the library to highlight search terms:

```
use dobron\HighlightLite\Configuration;
use dobron\HighlightLite\HighlightFactory;

$configuration = Configuration::create()
    ->setInsideWords(true)
    ->setFindAllOccurrences(true)
    ->setRequireMatchAll(true);

$highlightResult = (new HighlightFactory())
    ->create($configuration)
    ->highlight('hawking history of time', 'Stephen Hawking: A Brief History of Time');

echo $highlightResult->getHighlightedText(); // Stephen Hawking: A Brief History of Time
```

⚙️ Configuration Options
------------------------

[](#️-configuration-options)

You can customize the library with the following methods:

MethodDescriptionDefault`setInsideWords(bool $insideWords)`Enables or disables highlighting inside words.`false``setFindAllOccurrences(bool $findAllOccurrences)`Enables or disables finding all occurrences of the search term.`false``setRequireMatchAll(bool $requireMatchAll)`Enables or disables requiring all search terms to match.`false``setMatchShortcuts(bool $matchShortcuts)`Enables or disables matching shortcuts of the search terms.`false`📅 Change Log
------------

[](#-change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

🧪 Testing
---------

[](#-testing)

```
$ composer tests
```

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

⚖️ License
----------

[](#️-license)

This repository is MIT licensed, as found in the [LICENSE](LICENSE) file.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance69

Regular maintenance activity

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Every ~112 days

Total

4

Last Release

179d ago

### Community

Maintainers

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

---

Top Contributors

[![richardDobron](https://avatars.githubusercontent.com/u/33115305?v=4)](https://github.com/richardDobron "richardDobron (7 commits)")

---

Tags

highlighthighlightingresultssearch

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/richarddobron-highlight-lite/health.svg)

```
[![Health](https://phpackages.com/badges/richarddobron-highlight-lite/health.svg)](https://phpackages.com/packages/richarddobron-highlight-lite)
```

###  Alternatives

[awesome-nova/dependent-filter

Dependent filters for Laravel Nova

26193.1k](/packages/awesome-nova-dependent-filter)[algolia/php-dom-parser

A simple tool to turn DOM into Algolia search friendly record objects.

181.8k](/packages/algolia-php-dom-parser)

PHPackages © 2026

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