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(4mo ago)010.2k↑291.7%MITPHPPHP ^7.4 || ^8.0CI passing

Since Feb 1Pushed 4mo 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 1mo 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

39

—

LowBetter than 86% of packages

Maintenance76

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

134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ce70053083f807f4416f0bafe680691b66cd14f3c1bdf7b3df51b6f5b5cfdea?d=identicon)[dobron](/maintainers/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

[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[shyim/opensearch-php-dsl

OpenSearch/Elasticsearch DSL library

175.9M9](/packages/shyim-opensearch-php-dsl)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)

PHPackages © 2026

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