PHPackages                             asimlqt/encode-decode - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. asimlqt/encode-decode

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

asimlqt/encode-decode
=====================

Encode/Decode library for PHP

0.0.2(8y ago)077Apache-2.0PHPPHP &gt;=5.6.0

Since Nov 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/asimlqt/encode-decode)[ Packagist](https://packagist.org/packages/asimlqt/encode-decode)[ Docs](https://github.com/asimlqt/encode-decode)[ RSS](/packages/asimlqt-encode-decode/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

encode-decode
=============

[](#encode-decode)

This small library provides a simple and consistent way to encode and decode data in php. Either due to a non-existent native solution or to wrap the native calls to provide a simpler interface and error handling.

Currently there are only 2 encoders:

- Base64Url
- Json

### Base64Url

[](#base64url)

Encode example

```
    try {
        $encoder = new Base64Url();
        $encoded = $encoder->encode("Encode/Decode library for PHP");
    } catch (EncodingException $e) {
        // handle exception
    }
    // encoded === "RW5jb2RlL0RlY29kZSBsaWJyYXJ5IGZvciBQSFA"

```

Decode example

```
    try {
        $encoder = new Base64Url();
        $decoded = $encoder->decode("RW5jb2RlL0RlY29kZSBsaWJyYXJ5IGZvciBQSFA");
    } catch (DecodingException $e) {
        // handle exception
    }
    // decoded === "Encode/Decode library for PHP"

```

### Json

[](#json)

Encode example

```
    try {
        $encoder = new Json();
        $encoded = $encoder->encode(["encode" => "decode"]);
    } catch (EncodingException $e) {}

```

Decode example

```
    try {
        $encoder = new Json();
        $decoded = $encoder->decode('{"encode":"decode"}');
    } catch (DecodingException $e) {}

```

By default decode will return an array, if you want to decode to an object then set assoc to false:

```
    $encoder->setAssoc(false);

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~217 days

Total

2

Last Release

3276d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d1ba605a0d5efec9649a10ac22f37d0c140e8ee928daac34686e987719bee17?d=identicon)[Asim](/maintainers/Asim)

---

Top Contributors

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

---

Tags

phpjsonbase64encodedecodebase64url

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/asimlqt-encode-decode/health.svg)

```
[![Health](https://phpackages.com/badges/asimlqt-encode-decode/health.svg)](https://phpackages.com/packages/asimlqt-encode-decode)
```

###  Alternatives

[kherge/json

Encodes, decodes, and validates JSON data.

60234.2k6](/packages/kherge-json)[serafim/json5

JSON5 parser

231.0k](/packages/serafim-json5)

PHPackages © 2026

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