[eluser]livewirerules[/eluser]
im using the below code to upload multiple image, take the image file name, concatenate with "," and return the value so it can be used to insert into the database.
The problem that im having is im unable to concatenate the file names using implode().
Can someone please tell me what am i doing wrong?
Code:
function upload(){
$config['upload_path'] = './uploadsim/';
$config['allowed_types'] = 'gif|jpg|jpeg';
$config['max_size'] = '0';
$config['max_width'] = '0';
$config['max_height'] = '0';
$this->load->library('upload', $config);
for($i = 1; $i < 6; $i++) {
$upload = $this->upload->do_upload('image'.$i);
if($upload === FALSE) continue;
$images = array('upload_data'=>$this->upload->data());
$imagename= $images['upload_data']['file_name'];
$impl= implode(",", $imagename);
}
return $impl;
}