• 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

Sum column values from multiple arrays

How Can I Do LIMIT 1, 2 In WP_Query

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

php 7 php.ini upload_max_filesize not working

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

Attempted to call an undefined method named "get" of class "MailController"

dompdf and img tag, image wont show

Access relation of pivot table in Laravel

Toggle between a textbox and a select using PHP

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

Performance of foreach, array_map with lambda and array_map with static function

Add a custom text for a particular product on specific email notification in Woocommerce

Target class controller does not exist - Laravel 8

How to submit the custom form data in database in WordPress without plugin using ajax?

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

About Contact Privacy policy Terms and conditions