• 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

PHP array slice from position + attempt to return fixed number of items

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

enable Apache http Authorization header

Not able to override collapsible.js in magento 2

PHP: How to quickly split a key=value file into associative array

Debugging Stripe Webhook Event

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

hidden INPUT value not available in $_POST

Error converting docx to pdf using Unoconv

Add rows to Single product Additional information table in WooCommerce 3.6

Handle error for duplicate entries - PHP/MySQL

Laravel 5.1 Unknown database type enum requested

Utf8 encoding issue with Laravel

Laravel phpunit test failing authorization

Laravel SQL query midnight time not showing

About Contact Privacy policy Terms and conditions