My array is :
$array= array(4,3,4,3,1,2,1);
And I\'d like to output it like below:
Output = 2
(As 2 i
If in your scenario there will be only one unique value you could use:
$array= array(4,3,4,3,1,2,1); $singleValue = array_search(1, array_count_values($array)); var_dump($singleValue) // Outputs: 2