• 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 8.1: strftime() is deprecated

MISSING UPDATES FOR: MEDIA Drupal 9

Error converting docx to pdf using Unoconv

Split a string array into pieces

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

Spam Filter in Contact Form

cakephp save drag and drop list order to database

Laravel PackageManifest.php: Undefined index: name

How to implement placeholder in a php file for moodle plugin?

Laravel s3 upload file with metadata using pre-signed url

PHP - installing Xdebug on Mac with XAMPP (Unix File)

Array to string conversion

How to validate tin and cst using PHP?

How to MODIFY a Google Docs document via API using search-and-replace?

Facebook PHP SDK - will not logout properly

About Contact Privacy policy Terms and conditions