PHP code example of lupsor / array-parser

1. Go to this page and download the library: Download lupsor/array-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lupsor / array-parser example snippets

t
use Lupsor\ArrayParser\ArrayParser;

$data = [
    'one' => 'oneValue',
    'three' => [
        'one' => ['one' => 'threeOneOneValue',],
    ],
];
$parserString = 'three->one->one';

ArrayParser::parse($data, $parserString);
t
use Lupsor\ArrayParser\ArrayParser;

$data = [
    'four' => [
        ['one' => 'fourOneValue',],
        ['one' => 'fourTwoValue',],
    ],
];
$parserString = 'four->[one]';

ArrayParser::parse($data, $parserString);
t
use Lupsor\ArrayParser\ArrayParser;

$data = [
    'five' => [
        [
            'one' => [
                ['one' => 'fiveOneOneValue',],
                ['one' => 'fourOneTwoValue',],
            ],
        ],
        [
            'one' => [
                ['one' => 'fiveTwoOneValue',],
                ['one' => 'fourTwoTwoValue',],
                ['one' => 'fourTwoThreeValue',],
            ],
        ],
    ],
];
$parserString = 'five->[one->[one]]';

ArrayParser::parse($data, $parserString);

composer install lupsor/array-parser