I want to invert my array, can I do this? If Yes then please write a piece of code.

$array=array_flip($array)

Exchanges all keys with their associated values in an array

array_flip() returns an array in flip order, i.e. keys from trans become values and values from trans become keys.