• 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

Respond with status code 401 on authentication failure using Laravel and Passport?

How to get monthly wise data in laravel

Statement that checks whether a URL contains a particular path?

how to get value from array in laravel

XDebug not working in VScode for php debugging

file_get_contents() without "Http" to access external URL [closed]

Laravel Model save() & update() Not Saving

php code to send checkbox form results to email

Laravel Excel::store file empty after stored

How to make a array inside array?

PHP: PDO + CSV export not downloading (headers issue?)

How to get quarter for future date using Carbon?

Check If array is null or not in php

Read users and passwords from a txt file

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

About Contact Privacy policy Terms and conditions