From http://www.w3schools.com (Copyright Refsnes Data)

PHP array_flip() Function


PHP Array Reference Complete PHP Array Reference

Definition and Usage

The array_flip() function returns an array with all the original keys as values, and all original values as keys.

Syntax

array_flip(array)

Parameter Description
array Required. Specifies an array


Example

<?php
$a=array(0=>"Dog",1=>"Cat",2=>"Horse");
print_r(array_flip($a));
?> 

The output of the code above will be:

Array ( [Dog] => 0 [Cat] => 1 [Horse] => 2 )


PHP Array Reference Complete PHP Array Reference

From http://www.w3schools.com (Copyright Refsnes Data)