note 52715 added to function.array-combine
| From: | ungu at terong dot com | Date: | Tue, 10 May 2005 18:39:26 +0000 |
| Subject: | note 52715 added to function.array-combine | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89225@lists.php.net to get a copy of this message | ||
Simpler version of array_combine if you do not use PHP 5
<?
if (!function_exists('array_combine')) {
function array_combine($a, $b) {
$c = array();
$at = array_values($a);
$bt = array_values($b);
foreach($at as $key=>$aval) $c[$aval] = $b[$key];
return $c;
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.array-combine.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52715
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52715&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52715&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52715&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52715&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52715&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52715&report=yes
Search -- http://master.php.net/manage/user-notes.php