5 行目にこの警告があります。警告: foreach() に無効な引数が指定されました
if (!function_exists('get_user_online_count')) {
function get_user_online_count($type=false,$full=true) {
global $counter_matrix;
$user_types=array();
foreach($counter_matrix as $key=>$val){
if(!isset($user_types[$val['user_type']])){
$user_types[$val['user_type']] = 0;
}
$user_types[$val['user_type']] ++;
}
if($full){
$print = '';
while(count($user_types)){
$user_type = key($user_types);
$user_count = array_shift($user_types);
if($type && $user_type != $type)continue;
if($print!=''){
if(count($user_types))$print .= ', ';
else $print .= ' and ';
}else{
}
$print .= $user_count . ' ' . $user_type . (($user_count>1)?'s':'');
}
if(!$print){
if($type){
$print = '0 '.$type.'s online';
}else{
$print = '0 Users online';
}
}else{
$print .= ' online';
}
return $print;
}else{
if($type){
return (isset($user_types[$type])) ? $user_types[$type] : 0;
}else{
return count($counter_matrix);
}
}
}
}
この行に警告があります 'foreach($counter_matrix as $key=>$val){'
ここで何が問題なのですか?