• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to loop a tree array with unknown depth and get array blocks?

phpmultidimensional-arraytree


PHP Snippet 1:

function saveAllValues($arr) {
    save_to_db($arr['id'], $arr['name'], $arr['is_master'], $arr['master_id']);
    if ($arr['has_children']) {
        array_map('saveAllValues, $arr['nodes']);
    }
}

Related Snippets

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

How can i call a function that executes an fpdf based on the choice of a form selector?

Laravel Collections. Is there some kind of assertStructure method?

Check if user online laravel

How to redirect to another page and call a Function there on Angular ng-click

How to add a custom field to all Woocommerce attribute terms using add_action

Magento 2 - How to add new block to admin panel in product page?

jQuery Ajax Post with data

get attribute from class not working php 7

getting error while enter Command => php artisan route:list

wp_remote_get() not passing authentication

Laravel eloquent update record without loading from database

Additional price based on cart item count in WooCommerce

Prestashop webservice API creating cart rules

Laravel Command Schedule Not Working Properly

About Contact Privacy policy Terms and conditions