PHP » GoLang |
login |
register |
about
|
array_flip(PHP 4, PHP 5, PHP 7) array_flip — Exchanges 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 Values
Returns the flipped array on success and Examples
Example #1 array_flip() example
<?php The above example will output: Array ( [oranges] => 0 [apples] => 1 [pears] => 2 )
Example #2 array_flip() example : collision
<?php The above example will output: Array ( [1] => b [2] => c ) See Also
|
more
Recently updated
more
Most requested
more
Last requests
|