PHPackages                             raryk/highlight - 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. raryk/highlight

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

raryk/highlight
===============

A small library for cutting links and searching

v1.0.0(3y ago)06MITPHPPHP ~7.0|~8.0

Since Sep 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/raryk/highlight)[ Packagist](https://packagist.org/packages/raryk/highlight)[ Docs](https://github.com/raryk/highlight)[ RSS](/packages/raryk-highlight/feed)WikiDiscussions master Synced today

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

Highlight
=========

[](#highlight)

This library will allow you to highlight text and links

Install
-------

[](#install)

Via Composer

```
$ composer require raryk/highlight
```

Usage
-----

[](#usage)

```
$highlight = new Highlight();

$highlight->setSearch('search text');
foreach($highlight->string('testing search text and link https://example.com') as $string) {
    if(isset($string['link'])) {
        echo '';
        foreach($string['string'] as $string) {
            if($string['type'] == 'search') {
                echo '' . $string['text'] . '';
            } else {
                echo '' . $string['text'] . '';
            }
        }
        echo '';
    } else {
        if($string['type'] == 'search') {
            echo '' . $string['text'] . '';
        } else {
            echo '' . $string['text'] . '';
        }
    }
}

echo '';

$highlight->setSearch('and link https://');
foreach($highlight->string('testing search text and link https://example.com') as $string) {
    if(isset($string['link'])) {
        echo '';
        foreach($string['string'] as $string) {
            if($string['type'] == 'search') {
                echo '' . $string['text'] . '';
            } else {
                echo '' . $string['text'] . '';
            }
        }
        echo '';
    } else {
        if($string['type'] == 'search') {
            echo '' . $string['text'] . '';
        } else {
            echo '' . $string['text'] . '';
        }
    }
}
```

Contributing
------------

[](#contributing)

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

Credits
-------

[](#credits)

- [Andriy Raryk](https://github.com/raryk)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1416d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eeeec90dae6b89d1bf42c19da0202d3a058d00b7051f69dc5ff646645e47841c?d=identicon)[raryk](/maintainers/raryk)

---

Top Contributors

[![raryk](https://avatars.githubusercontent.com/u/28709905?v=4)](https://github.com/raryk "raryk (1 commits)")

---

Tags

highlightraryk

### Embed Badge

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

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

###  Alternatives

[scrivo/highlight.php

Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js

71449.4M120](/packages/scrivo-highlightphp)[easybook/geshi

GeSHi - Generic Syntax Highlighter. This is an unmodified port of GeSHi project code found on SourceForge.

221.1M10](/packages/easybook-geshi)[nezhelskoy/yii2-highlight

Yii2 highlight.js extension

1432.6k](/packages/nezhelskoy-yii2-highlight)[rg/phpnsc

40143.8k](/packages/rg-phpnsc)[ramsey/pygments

A PHP wrapper for Pygments, the Python syntax highlighter, forked from kzykhys/pygments.

103.2k3](/packages/ramsey-pygments)

PHPackages © 2026

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