• 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

Calculating Median of an array in PHP

possible options to create pdf file using html elements to generate invoice in php and codeigniter

How to get quarter for future date using Carbon?

How to run or debug php on Visual Studio Code (VSCode)

Why does using salted hash on python and php give me different results?

Refresh specific HTML content that retrieves data from MySQL

Live search query using JS and PHP for QA forum

Python - Include another Python script

How to convert time from one timezone to another in PHP

Image upload not working through ajax Laravel

Assets not referencing to public folder (Laravel)

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

Combine multiple columns into an array as one of the key in a results set

How to validate tin and cst using PHP?

How can I get data from PHP to Android TextView?

About Contact Privacy policy Terms and conditions