note 60210 deleted from function.array-merge by cmb
| From: | cmb@php.net | Date: | Mon, 19 Nov 2018 17:00:45 +0000 |
| Subject: | note 60210 deleted from function.array-merge by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209726@lists.php.net to get a copy of this message | ||
Note Submitter: hs at nospam dot magnum-plus dot com
----
The same result as produced by snookiex_at_gmail_dot_com's function
can be achieved with the 'one-liner'
<?php
$array1=array(1,2,3);
$array2=array('a','b','c');
$matrix = array_map(null, $array1, $array2);
?>
(see documentation of array_map).
The difference here is, that the shorter array gets filled with empty values.