Core Function Combine
From Sputnik Wiki
Combine( <array-keys>, <array-values> )
Contents |
Description
Creates a hash (Dictionary) by using the values from the keys array as keys and the values from the values array as the corresponding values.
Parameters
array-keys
The array to use for keys.
array-values
The array to use for values.
Return Value
Success - Returns new array with merged keys + values.
Failure - Returns empty array.
Remarks
None.
Example
$a = array('green', 'red', 'yellow'); $b = array('avocado', 'apple', 'banana'); $c = combine($a, $b); foreach($c as $key => $value) { println("Key: $key <=> Value: $value"); }