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

  • Home
  • SEARCH
  • 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 7739925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:38:43+00:00 2026-06-01T08:38:43+00:00

I have the array Array ( [0] => Array ( [field_yourrating_rating] => 100 )

  • 0

I have the array

Array ( [0] => Array ( [field_yourrating_rating] => 100 ) [1] => Array ( [field_yourrating_rating] => 80 ) [2] => Array ( [field_yourrating_rating] => 100 ) ) 

I want to be able to count the number of occurences of each value – for exmaple, 100 appears 1 time, and 80 appears one time.

I tried using array_count_values but it doesn’t seem to work with a multidimensional array! What else can I try?

  • 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-01T08:38:45+00:00Added an answer on June 1, 2026 at 8:38 am

    If the array is only ever structured as it is in your example then this will work:

      foreach ($array as $value)
      {
        $count[current($value)] += 1;
      }
    

    And then $count will be an array where the keys are the values of the input array and the values are the number of times they occur.

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

Sidebar

Related Questions

I have an array and I want to sort by the number field not
I want to uapdate a table field with an array.That means i have a
I have an array of structs and one of the fields in the struct
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>
I have array of strings, String[] data and it's 10 elements has value P
I have an array containing much more items than just this one. This is
I have an array of arrays with arrays in PHP and I want to
I have an array list that could contain component or composite and each component
I have an array list called str, i want to see the elements inside
I Have to Remove The Key of One Array Of Not Have in Another

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.