Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


Question:array_combine:how to use array_combine using php?


Creates an array by using one array for keys and another for its values

array array_combine ( array $keys , array $values )

$a = array('green', 'red', 'yellow');
$b = array('avocado', 'apple', 'banana');
$c = array_combine($a, $b);
 
print_r($c);
?>
 
The above example will output:
Array
(
    [green]  => avocado
    [red]    => apple
    [yellow] => banana
)

 


asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
11 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...