Download the PHP package lupsor/array-parser without Composer

On this page you can find all versions of the php package lupsor/array-parser. 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 array-parser

Lupsor Array Parser

Total Downloads Latest Stable Version License

About package

This package get data from an associative array.

Knowing the path to the data you need in the array, you can easily get it using ArrayParser, without having to iterate through the array yourself.

Содержание

  1. Setup
  2. Using
    1. ParserString
      1. Without collection
      2. With collection
    2. Parse object
    3. Examples of using
  3. Additionally
    1. Unique values

Setup

To install the package, run on the command line:

Using

To get the desired value, run: ArrayParser::parse($data, $parserString), where $date is an array from which you want to get the value, and $parserString is a link to the received data

ParserString

Without collection

Before you get the necessary data, you need to form a link to the data you need. Example:

three->one->one, where three, one and one - are the array key, and -> is the separator.

Based on this example, the ArrayParser will refer to the array element with the key three, there it will refer to the element with the key one and it will get the value of the element with the key one.

With collection

You can also get data from the collection by wrapping the required value in square brackets ([, ]). Example:

three->[one], where [one] - collection. The parser will iterate over all the values in the element with the key "three" and from each element of the array will get the value with the key "one".

The collection can be more complex, like [one->two]. You can learn more about this structure in example No. 2 and 3.

Parse object

The first argument ArrayParser::parse ($data) can be sent as an object, in which case the path must only point to functions that require no arguments.

Examples of using

Example 1 (without collection)

The result of running this example will be: threeOneOneValue

Example 2 (with collection)

Result: fourOneValue, fourTwoValue

Example 3 (with collection)

Result: fiveOneOneValue, fourOneTwoValue, fiveTwoOneValue, fourTwoTwoValue, fourTwoThreeValue

Additionally

Unique values

You can return only unique values by adding :unique at the end of ParserString. Example: five->[one->[one]]:unique


All versions of array-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8
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 lupsor/array-parser contains the following files

Loading the files please wait ....