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!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The array_unique function typecasts the elements of an array as strings by default before comparison.
You might want to try:
or
http://php.net/manual/en/function.array-unique.php