duanpi2033 2013-12-18 13:23
浏览 23

将元素推入codeigniter中的数组

I am new to codeigniter and I have following array:

$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')

            );

I want to push following item in that

$data = array_push($data, 'userfile', $_FILES['userfile']['name']);

Please make correction in it. How to push an element in to an array.

  • 写回答

1条回答 默认 最新

  • dongyun7897 2013-12-18 13:25
    关注

    Just do this

    $data['userfile']=$_FILES['userfile']['name'];
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器