....数组问题...晕.
<?php
/**
*替代我从数据库中查询的结果数组
*/
for($i=0;$i<=3;$i++){
$a[$i] = $i;
for($j=0;$j<=3;$j++){
$b[$i][$j] = $i."=>".$j;
}
}
/**
*在查询结果中添加其他的表的信息--新字段
*我需要添加多张表的统计数据到该查询数组中
*/
foreach($b as $key=>$value){
//$sql = "select count(*) from talbe where id = $value[id]";
//$rst = mysql_query($query);
//$row = mysql_fetch_array($rst);
//$num = $row[0];
$num = "mytest";
array_push($b[$key],"all_num=>".$num);//不对
}
print_r($b);
//我希望能购输出
$b[0][all_num] = "mytest";
//而不是通过$b[0][5]输出 。。。
//偶的程序中不可能每次去数插入的
//新数据字段在那个位置
?>