Why use array_flip() function in php.?
The array_flip() function mainly used for exchanging all keys with their associated values in an array.
Syntax of array_flip() function:
array_flip(array)
You can take reference form below example to use of array_flip() function in php.
<?php
//$City is a array_name
$City=array("a"=>"Addor","b"=>"Anjar","c"=>"Bargarh","d"=>"Chatra");
//call the array_flip() function
$Getresult=array_flip($City);
//print for $Getresult for output
print_r($Getresult);
?>
output will come:
Array ( [Addor] => a [Anjar] => b [Bargarh] => c [Chatra] => d )
0 Comment(s)