note 39338 added to ref.array
| From: | alan-smith at belcenter dot com | Date: | Sun, 25 Jan 2004 14:11:42 +0000 |
| Subject: | note 39338 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64141@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/ref.array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39338
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39338&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39338&report=yes
Search -- http://master.php.net/manage/user-notes.php