note 69547 deleted from function.array-combine by nlopess
| From: | nlopess@php.net | Date: | Thu, 15 Feb 2007 13:22:41 +0000 |
| Subject: | note 69547 deleted from function.array-combine by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123438@lists.php.net to get a copy of this message | ||
Note Submitter: MSpreij, c/o GMail
----
And another one..
<?php
if (! function_exists('array_combine')) {
function array_combine($keys, $values) {
foreach($keys as $key) $out[$key] = array_shift($values);
return $out;
}
}
?>
If there are less values then keys, the extra values will be NULL (that's what array_shift
returns).