I have an array of floats.
When I use array_unique, if I have a 0 value, it's left out of the result.
Is this correct, or is there a way around this? What's the proper syntax to make it include 0s.
Thanks in advance!
The array_unique function typecasts the elements of an array as strings by default before comparison.
You might want to try:
array_unique($array, SORT_NUMERIC);
or
array_unique($array, SORT_REGULAR);