1. Go to this page and download the library: Download kelemen/recursor 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/ */
# Used as item key in result array
abstract protected function getItemKey($item, $key);
# Get parent key for given item
abstract protected function getParentItemKey($item, $key);
# Returns result item structure as array
abstract protected function getItemData($item, $key, $childrenCount, $level);
# Called after build every item
protected function afterItemHook(&$item);
# Called after build result array
protected function afterAllHook(&$items);