我是 codeigniter 的新手,我有以下数组:
$data = array(
'username' => $this->input->post('uname'),
'fname' => $this->input->post('fname'),
'lname' => $this->input->post('lname'),
'phone' => $this->input->post('phone'),
'email' => $this->input->post('email'),
'password' => $this->input->post('pass'),
'bdate' => $this->input->post('date'),
'status' => $this->input->post('status')
);
我想在其中推送以下项目
$data = array_push($data, 'userfile', $_FILES['userfile']['name']);
请更正其中。 如何将元素插入数组。
最佳答案
就这样
$data['userfile']=$_FILES['userfile']['name'];
关于php - 将元素插入codeigniter中的数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20659396/