Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:16:11+00:00 2026-06-14T14:16:11+00:00

I have an array of floats. When I use array_unique, if I have a

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:16:12+00:00Added an answer on June 14, 2026 at 2:16 pm

    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);
    

    http://php.net/manual/en/function.array-unique.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a System.Array of value struct types, something like this: public value struct
I ran some CUDA code that updated an array of floats. I have a
If I have this float array declaration: float tables[10]; How can I change the
I want to use longjmp to simulate goto instruction.I have an array DS containing
I have a c++ vector: vector<float> floats; Later, this vector is initialized. I don't
I currently have a large array of floats that I process in my OpenCL
I am trying to use an array of floats for my verticies in OpenGLES
I have a certain array of floats (in Python) that might range from 0
Lets say that i have the following array : float QuadVertices[4 * 2]; float
I have some Thread count pCount and I have some float[] array. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.