array_flip: Exchanges all keys with their associated values in an array
<?php $state = array("Delaware","Pennsylvania","New Jersey"); $state = array_flip($state); print_r($state); // Array ( [Delaware] => 0 [Pennsylvania] => 1 [New Jersey] => 2 ) ?>