Download the PHP package gemul/jsonparser without Composer

On this page you can find all versions of the php package gemul/jsonparser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jsonparser

PHP JSON Parser

Introduction

Welcome to the PHP JSON Library, a simple tool for handling JSON data in your PHP applications. This library provides a set of functions for reading JSON data from strings or files, manipulating JSON data, and conveniently handling cases where a key doesn't exist in your JSON structure by returning a default value.

Features

Installation

To get started, you can install the library using Composer:

Usage

1. Load JSON Data

Reading JSON from String

or from JSON file

you can alson define separator string used for traversing the json tree, in constructor's second parameter (default ".").

2. Getting JSON data

Given this json structure:

you can use to traverse the json tree and get the data.

it can also return the rest of the json branches, for example

Handling path that doesn't exist

if the path doesn't exist, the default value is returned which is either null (default) or anything you put on second parameter. It won't throw 'Undefined property' exception even if the whole path doesn't exist. So you can safely traverse without having to do check at every level.

3. Set a JSON data

In order to set a data to the tree, you can use for example

the json would become

You can safely make new depth to the path

Setting Array

For array data, you can explicitly use index, or use '[]' to change or append an element into either existing or new array.

will result in

3. Get last valid path

After executing , you can use to retrieve the last valid path that was successfully traversed by the getItem method.

4. Get the current full JSON object

To get the current json as an object, use . Or alternatively the json-encoded string using .

5. Save json string to file

To save the json string, use

make sure that the directory is writable.


All versions of jsonparser with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gemul/jsonparser contains the following files

Loading the files please wait ....