note 39340 added to function.array-combine
| From: | alan-smith at belcenter dot com | Date: | Sun, 25 Jan 2004 14:12:27 +0000 |
| Subject: | note 39340 added to function.array-combine | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64143@lists.php.net to get a copy of this message | ||
<?php
function array_combine($array_keys, $array_values) {
/*
* Returns an array by using the values from the keys array
* as keys and the values from the values array as the corresponding values.
*/
$t = array();
$lg = count($array_keys);
for($i=0;$i<$lg;$i++){
$key = $array_keys[$i];
$t[$key] = $array_values[$i];
}
return $t;
}
// Usage : array_combine (array_keys, array_values);
?>
----
Manual Page -- http://www.php.net/manual/en/function.array-combine.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39340
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39340&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39340&report=yes
Search -- http://master.php.net/manage/user-notes.php