当然我知道不必非这样,但是这里主要是想弄会这个问题。谢谢。
回复讨论(解决方案)
这样吗?
'张三', 'score' => '100' ), array( 'name' => '李四', 'score' => '90' ));$data[0]['school'] = 'school1';$data[1]['school'] = 'school2';echo '';print_r($data);?>
Array
(
[0] => Array
(
[name] => 张三
[score] => 100
[school] => school1
)
[1] => Array
(
[name] => 李四
[score] => 90
[school] => school2
)
)
既然是 通过数据库查询得到一个数组
那么你在读取查询结果时就可加进去了
while($row = mysql_fetch_assoc($rs)) { $row['毕业院校'] = getyx($row['name']); $data[] = $row;}