RosettaCodeData/Task/Hash-from-two-arrays/PHP/hash-from-two-arrays-2.php
2023-07-01 13:44:08 -04:00

6 lines
159 B
PHP

$keys = array('a', 'b', 'c');
$values = array(1, 2, 3);
$hash = array();
for ($idx = 0; $idx < count($keys); $idx++) {
$hash[$keys[$idx]] = $values[$idx];
}