Q:
Answer
array_flip exchange the keys with their associated values in array ie. Keys becomes values and values becomes keys.
<?php
$arrayName = array("course1"=>"php","course2"=>"html");
$new_array = array_flip($arrayName);
print_r($new_array);
?>
OUTPUT :
Array
(
[php] => course1
[html] => course2
)
View answer
Workspace
Report Error
Discuss