代码如下
function setKeyField($temp,$keyfield){ foreach ($temp as $key => &$row) { if (isset($row[$keyfield])) { $rs[$row[$keyfield]] = $row; } else { $rs[] = $row; } } return $rs; }
代码如下
function setKeyField($temp,$keyfield){ foreach ($temp as $key => &$row) { if (isset($row[$keyfield])) { $rs[$row[$keyfield]] = $row; } else { $rs[] = $row; } } return $rs; }