获取传递到$ data ['rowVideo']的数据库,但我想更改/修改数组中的值?这样做最好的方法是什么?
$SQL = "SELECT * FROM video";
$query = $this->db->query($SQL);
$data['rowVideo'] = $query->fetchAll(PDO::FETCH_ASSOC);
foreach ($data['rowVideo'] as $key => $value) {
// do some $data['rowVideo'] alteration
// How would you do it?
}
$this->load->view('content', $data);
答案 0 :(得分:2)
只是做:
$data['rowVideo'][$key] = $modifiedValueCreatedFromValue;