|
array_flipExchanges all keys with their associated values in an array Description
array array_flip(array
$array)
array_flip returns an array in flip
order, i.e. keys from
Note that the values of If a value has several occurrences, the latest key will be used as its value, and all others will be lost. Parameters
Return ValuesReturns the flipped array. Examples
Example #1 array_flip example The above example will output:
Array
(
[oranges] => 0
[apples] => 1
[pears] => 2
)
Example #2 array_flip example : collision The above example will output:
Array
(
[1] => b
[2] => c
)
See Also
|