PHPackages                             abdelhamiderrahmouni/toon-php - 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. abdelhamiderrahmouni/toon-php

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

abdelhamiderrahmouni/toon-php
=============================

Token-Oriented Object Notation – Associative arrays and JSON for LLMs at half the token cost. this is a PHP port of johannschopplich/toon.

v0.1.0(6mo ago)3142[1 PRs](https://github.com/abdelhamiderrahmouni/toon-php/pulls)MITPHPPHP &gt;=8.1

Since Oct 29Pushed 6mo agoCompare

[ Source](https://github.com/abdelhamiderrahmouni/toon-php)[ Packagist](https://packagist.org/packages/abdelhamiderrahmouni/toon-php)[ RSS](/packages/abdelhamiderrahmouni-toon-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Toon PHP
========

[](#toon-php)

Toon PHP encodes PHP associative arrays and objects into the TOON format ([Token‑Oriented Object Notation](https://github.com/johannschopplich/toon)). It’s built first for PHP data structures—arrays and plain objects—and also works with JSON inputs by decoding them before encoding.

It favors:

- Inline arrays for primitives
- Tabular rows for uniform arrays of objects
- Safe string quoting to avoid ambiguity
- Customizable indentation, delimiters, and an optional array length marker

This makes structured PHP data easy for humans to scan while staying unambiguous for machines (and token‑efficient for LLMs).

---

Installation
------------

[](#installation)

Install via Composer (replace with your package name once published):

```
composer require abdelhamiderrahmouni/toon-php
```

---

Quick Start (arrays and objects)
--------------------------------

[](#quick-start-arrays-and-objects)

```
