PHPackages                             funsoul/funcompare - 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. funsoul/funcompare

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

funsoul/funcompare
==================

A tool compare text differences

1.2(8y ago)63652MITPHPPHP &gt;=5.3

Since Feb 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/funsoul/funcompare)[ Packagist](https://packagist.org/packages/funsoul/funcompare)[ Docs](https://github.com/funsoul/funcompare)[ RSS](/packages/funsoul-funcompare/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (4)Used By (0)

funcompare
==========

[](#funcompare)

A tool compare text differences

Installation
============

[](#installation)

```
composer require "funsoul/funcompare: ~1.1"

```

Usage
=====

[](#usage)

### compareText()

[](#comparetext)

```
use Funsoul\Funcompare\Funcompare;

$old = 'A tool compare text differences is funny';
$new = 'A tool that compare text differences';

$fc = new Funcompare();
$res = $fc->compareText($old, $new);
echo $res;

// A tool that compare text differences is funny
```

### compareJson()

[](#comparejson)

```
use Funsoul\Funcompare\Funcompare;

$old = '[{"id":1,"name":"xxx","age":18,"cart":[{"id":100,"name":"rice"}]},{"id":2,"name":"aaa","age":18}]';
$new = '[{"id":1,"name":"yyy","age":20,"cart":[{"id":100,"name":"banana"}]},{"id":2,"name":"bbb","age":18}]';

$fc = new Funcompare();
$res = $fc->compareJson($old, $new);
echo $res

// [{"name":{"old":"xxx","new":"yyy"},"age":{"old":"18","new":"20"},"cart":[{"name":{"old":"rice","new":"banana"}}]},{"name":{"old":"aaa","new":"bbb"}}]
```

```
[
    {
        "name":{
            "old":"xxx",
            "new":"yyy"
        },
        "age":{
            "old":"18",
            "new":"20"
        },
        "cart":[
            {
                "name":{
                    "old":"rice",
                    "new":"banana"
                }
            }
        ]
    },
    {
        "name":{
            "old":"aaa",
            "new":"bbb"
        }
    }
]
```

### css

[](#css)

```

    .new-word{background:rgba(245,255,178,1.00)}
    .new-word:after{content:' '; background:rgba(245,255,178,1.00)}
    .old-word{text-decoration:none; position:relative}
    .old-word:after{
        content: ' ';
        font-size: inherit;
        display: block;
        position: absolute;
        right: 0;
        left: 0;
        top: 55%;
        bottom: 30%;
        border-top: 1px solid #000;
        border-bottom: 1px solid #000;
    }

```

### wrapper()

[](#wrapper)

```
use Funsoul\Funcompare\Funcompare;

$old = 'A tool compare text differences is funny';
$new = 'A tool that compare text differences';

$fc = new Funcompare();
$res = $fc->wrapper('[',']','')->compareText($old, $new);
echo $res;

// A tool  compare text differences [is] [funny]
```

License
=======

[](#license)

MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~0 days

Total

3

Last Release

2998d ago

### Community

Maintainers

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

---

Top Contributors

[![shuixn](https://avatars.githubusercontent.com/u/7775361?v=4)](https://github.com/shuixn "shuixn (8 commits)")

---

Tags

comparetextdifference

### Embed Badge

![Health badge](/badges/funsoul-funcompare/health.svg)

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

###  Alternatives

[froala/wysiwyg-editor

A beautiful jQuery WYSIWYG HTML rich text editor. High performance and modern design make it easy to use for developers and loved by users.

5.4k306.9k3](/packages/froala-wysiwyg-editor)[ckeditor/ckeditor

JavaScript WYSIWYG web text editor.

5234.2M76](/packages/ckeditor-ckeditor)[tinymce/tinymce

Web based JavaScript HTML WYSIWYG editor control.

1697.5M106](/packages/tinymce-tinymce)[unisharp/laravel-ckeditor

JavaScript WYSIWYG web text editor (for laravel).

377762.3k5](/packages/unisharp-laravel-ckeditor)[nojimage/twitter-text-php

A library of PHP classes that provide auto-linking and extraction of usernames, lists, hashtags and URLs from tweets.

1241.9M7](/packages/nojimage-twitter-text-php)[icecave/parity

A customizable deep comparison library.

516.8M10](/packages/icecave-parity)

PHPackages © 2026

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