• 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

Not able to access model in the controller mautic

HTML and PHP in one file

TesseractOCR not working for Laravel

Add Metadata, headers (Expires, CacheControl) to a file uploaded to Amazon S3 using the Laravel 5.0 Storage facade

Sum array values

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

Changing font color in javascript

Group data in a multidimensional array based on two columns

Get all WooCommerce products within own plugin

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

WHERE IN array binding in DB::raw laravel 5.4

How to downgrade or install a specific version of Composer?

Google Calendar API batch request PHP

Get latest Tweets - What API

Check if string contains a value in array [duplicate]

About Contact Privacy policy Terms and conditions