how to get which value has duplicate maximum times in php array : i have an array and i want to find out which value has duplicated maximum times in the array.Can you please help me to solve it?

Array ( [0] => 1 [1] => 2 [2] => 2 [3] => 1 [4] => 2 [5] => 2) 

The output i want is 2 as it has duplicated 4 times