这样吗?<?php
$data = array(
array(
'name' => '张三',
'score' => '100'
),
array(
'name' => '李四',
'score' => '90'
)
);$data[0]['school'] = 'school1';
$data[1]['school'] = 'school2';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
print_r($data);?>
Array
(
[0] => Array
(
[name] => 张三
[score] => 100
[school] => school1
) [1] => Array
(
[name] => 李四
[score] => 90
[school] => school2
))
$data = array(
array(
'name' => '张三',
'score' => '100'
),
array(
'name' => '李四',
'score' => '90'
)
);$data[0]['school'] = 'school1';
$data[1]['school'] = 'school2';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
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;
}