1. Go to this page and download the library: Download dottwatson/simple-data 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/ */
$array = simple_data($data); //returns a SimpleData\SimpleArray object
$object = simple_data($object); //returns a SimpleData\SimpleObject object
use SimpleData\SimpleArray;
$array = new SimpleArray($data);
$item = $array->get('bar');
$itemData = $array->get('bar')->value(); //returns [0,1,2,3,4,5]
//retrieve a value and back to its parent
$item = $array->get('bar');
$parentNode = $item->parent();