当我设置一个全局数组时
$items[$users[$clientID]['room']] = array("seat" => $seat, "item_id" => $q[1], "room" => $users[$clientID]['room']);
这是
$items[4] = array("seat" => 20, "item_id" => 10, "room" => 4);
但是当我数一数时,它告诉 $items[4] 的长度是 3?它应该只计算 1,因为我只有“1”项。
for ( $i=0;$i<count($items[$users[$clientID]['room']]);$i++):
//something
endfor;
print_r($items[$users[$clientID]['room']]);
输出:
Array
(
[seat] => 43
[item_id] => 46
[room] => 5
)
COUNT 3
我究竟做错了什么?