• 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

PHP Imap , php 7.4.3 on mac osx catalina

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

PHP file_get_contents function

How to connect to MSSQL Server with PHP from Ubuntu 18.04?

Symfony run hint kernel.secret parameter not found

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

PHPExcel_IOFactory::createWriter causes wrong behaviour

Laravel display validation error

Getting public posts of a random user from Facebook API

Debugging Stripe Webhook Event

Sum array values of a column within each column of an array with 3 levels

disable two buttons after clicking another button

Display a success custom notice after Placing an Order in WooCommerce

Cannot pass null argument when using type hinting

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

About Contact Privacy policy Terms and conditions