A PHP Error was encountered
Severity: Notice
Message: Undefined index: userid
Filename: views/question.php
Line Number: 191
Backtrace:
File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler
File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view
File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once
Given this array of arrays, how do I count the number of arrays that include a duplicate element within itself?
I have an array that looks like this:
[[["Sports", "Soccer"], 2], [["eSports"], 1], [["Sports", "Soccer"], 3]]
In any element of the outermost array, the first element (the array) are the list of categories. The second element is the program.id
this array of categories comes from.
So, taking the first element in the above array - ["Sports", "Soccer"]
is the array of categories for program_id: 2
.
How do I count the instances of the category array duplicates? In the above case, what I want is something like this:
["Sports", "Soccer"] => Occurs 2 times, with Program Ids: 2 & 3 ["eSports"] => Occurs 1 time, with Program Id: 1
How do I do that efficiently?