I'm trying to count the occurence of a string in multidimentional array and get it.
So I found this : http://php.net/manual/fr/function.array-count-values.php and an exemple in the "User Contributed Notes".
Here my code :
$count_values = array();
foreach ($Bigtable as $a)
{
foreach ($a as $table)
{
$count_values[$table]++; // line 32
}
}
asort($count_values,SORT_NUMERIC );
$onet_code=end ($count_values);
Here my error: Notice: Undefined index: 11-1011.00 in /home/goldiman1/www/postQuestion.php on line 32
I think that the error is in the last line when I try to get the string.
What do you guys think about it?
Thank you
Goldiman
Edit: Thank you everybody for your help ! All solutions work like a charm and I understood what was the issue, it was easier to understand Kasia answer because i'm more familiar with isset()