• 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

Transpose and flatten multiple rows of array data [duplicate]

phparraystransposeflattenarray-merge


PHP Snippet 1:

$a = array("a","b","c");
$b = array("d","e","f");
$c = array("g","h","i");

function array_zip(...$arrays) {
    return array_merge(...array_map(null, ...$arrays));
}

var_dump(array_zip($a,$b,$c));

Related Snippets

Adding Multiple Custom Post Types in Wordpress

Extract string between first whitespace and last whitespace in php

I want to store data in new index as per my key in php [duplicate]

PHP Get value from JSON [duplicate]

Yii2: How do I debug console commands?

how to loop through json response data using ajax jquery?

How can I get new CSRF token in LARAVEL by using ajax

Backend cannot be reached after Typo3 login screen

How to get an Array value inside an object in an array Php [duplicate]

Dropzone: Submit both form data and dropzone at once

Whats the point of running Laravel with the command 'php artisan serve'?

How to remove from a multidimensional array all duplicate elements including the original?

Live search query using JS and PHP for QA forum

display WooCommerce “Add to cart” button with short-code [add_to_cart ] dynamically

Printing more than one array using print_r or any other function in php

About Contact Privacy policy Terms and conditions