Another way would be to use array_diff, provided you only had two different numbers. Just compare the haystack of numbers to an array with a single number (pick one of the ones in the haystacks).
For example:
$haystack_mixed = array(2,2,2,1,1);
$haystack_1 = array(1,1,1,1);
$haystack_2 = array(2,2,2,2);
print_r(array_diff($haystack_mixed, array(1)));
// The result is not the same as the $haystack since there are 1's in it.
// Array ( [0] => 2 [1] => 2 [2] => 2 )
print_r(array_diff($haystack_1, array(1)));
// This one is made up of all 1's
// Array ( )
print_r(array_diff($haystack_2, array(1)));
// This one is made up of all 2's (same length as $haystack_2)
// Array ( [0] => 2 [1] => 2 [2] => 2 [3] => 2 )
So you can test the length of the resulting array.