PHPackages                             monster-anshu/jsonata-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. monster-anshu/jsonata-php

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

monster-anshu/jsonata-php
=========================

A PHP port of JSONata - a lightweight query and transformation language for JSON.

0.0.1(8mo ago)31.0k↑50%MITPHP

Since Aug 31Pushed 8mo agoCompare

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

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

JSONata-PHP
===========

[](#jsonata-php)

A PHP implementation of the [JSONata query and transformation language](http://jsonata.org/). This library allows you to query, transform, and manipulate JSON data structures in your PHP applications using the powerful and intuitive JSONata syntax.

What is JSONata?
----------------

[](#what-is-jsonata)

JSONata is a lightweight query and transformation language for JSON data. Inspired by XPath 3.1, it provides a powerful way to extract and reshape data from any JSON document. It's perfect for complex data manipulation, templating, and data mapping tasks.

Features
--------

[](#features)

- Support for basic JSONata queries.
- Map operator for simple transformations.
- Conditional logic.
- Simple, intuitive API.
- No external dependencies.
- Robust error handling.

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

[](#installation)

You can install the package via [Composer](https://getcomposer.org/):

```
composer require monster-anshu/jsonata-php
```

Usage
-----

[](#usage)

Using the library is straightforward. You create an instance of the `Jsonata` class, provide your JSONata expression, and then evaluate it against your data.

### Basic Example

[](#basic-example)

Here's a simple example of how to extract the `name` of each product from a JSON object.

```
