Install TOON for PHP

TOON is available in multiple languages. Choose your preferred ecosystem and start integrating TOON into your projects today.

Community

Installation

Add the official helgesverre/toon-php package to your project

composer require helgesverre/toon-php

Usage Example

Quick start guide for encoding and decoding TOON format in PHP

use HelgeSverre\Toon\Toon;
$data = ['name' => 'Alice', 'age' => 30];
echo Toon::encode($data);

No code needed to try it: paste data into the JSON to TOON converter, compare token counts in the TOON token calculator, or read the TOON format guide.