note 44392 added to function.array-combine
| From: | kevlaratccsdotneudotedu at rn2 dot php dot net | Date: | Wed, 04 Aug 2004 16:30:20 +0000 |
| Subject: | note 44392 added to function.array-combine | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73935@lists.php.net to get a copy of this message | ||
for those of you who do not have the ability to upgrade to php5 or dont want to bother with the pear
stuff and just want a simple function def this func that i put together may work just as well as the
php5 version
<?php
function arraycombine($a, $b) {
$num = count($a);
if ($num != count($b) || $num == 0) return false;
$a = array_values($a);
$b = array_values($b);
$c = array();
for ($i = 0; $i < $num; $i++) {
$c[$a[$i]] = $b[$i];
}
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+44392
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44392&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44392&report=yes
Search -- http://master.php.net/manage/user-notes.php