note 77231 deleted from function.array-combine by bjori
| From: | bjori@php.net | Date: | Thu, 21 Feb 2008 20:29:12 +0000 |
| Subject: | note 77231 deleted from function.array-combine by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136376@lists.php.net to get a copy of this message | ||
Note Submitter: Hayley Watson
----
Fred's code just previous isn't the simplest, given...
<?php
function array_combine($keys, $values)
{
$result = array();
foreach(array_map(null, $keys, $values) as $pair)
$result[$pair[0]]=$pair[1];
return $result;
}
?>
...if you're equally happy to avoid any sort of error checking of course.