I want to randomly shuffle the keys and values of a php array. I've already found solution to shuffle the order, but I want to shuffle the keys and values themselves.
The array array('yes' => 'oui', 'no' => 'non', 'hello' => 'bonjour') would for example become array('oui' => 'yes, 'no' => 'non', 'bonjour' => 'hello'). Note that the first and last value have randomly swapped key and value.
I know you can use array_flip to flip the keys and values in an array. But this flips all keys and values, while I want to randomly flip a few keys and values. How would I do this?