Q:

how to send hidden input values of multiple images from view to controller in codeigniter?

I want to pass hidden images name value to controller function and     
in my view updt-project-details.php file, displaying multiple images in update page and also check for valid extension and show image, I also remove image using ajax and javascript, if not exist, I just display "no documents found" and if exist then display images, the code like this,
<div class="row">
   <div class="col-sm-8">
       <input type="file" name="docs[]" multiple="multiple">
<?php $f = explode(',',$ans[0]->Proj_docs_path);
        foreach($f as $n){ if($n==''){ echo "<h4>No Documents Found.</h4>"; ?> <input type="hidden" name="p" value="<?php $arr=''; ?>"> <?php }else{ ?>      <a target="_blank" href="<?php echo base_url();?>images/project_docs/<?php echo $n; ?>">

        <img src="<?php echo base_url(); ?>images/<?php $azz = explode('.',$n);$ext = end($azz);if($ext=="pptx"||$ext=="ppt"){ ?>extensions_img/pptx.jpg<?php }elseif($ext=="pdf"){ ?>extensions_img/pdfimg.png <?php }elseif($ext=="docx"||$ext=="doc"){ ?>extensions_img/docximg.png <?php }elseif($ext=="xlsx"||$ext=="xls"){ ?>extensions_img/xlsx.png <?php }else{ ?>project_docs/<?php echo $n; }?>" style="margin:35px 25px;" height="100" width="100" class="img-thumbnail"><input type="hidden" name="p" value="<?php $arra = array(); $b = array_push($arra,$n);  ?>"></a>
        <a onclick="remove(<?php echo $m; ?> ,'<?php echo $n; ?>'); return confirm('Are You Sure to delete this!');" style="width:15px;height:15px;position: absolute;margin-left: -26px;margin-top: 10px;"><img src="<?php echo base_url(); ?>images/x.png" style="width:15px;height:15px;position: absolute;margin-left: -26px;margin-top: 10px;"></a>
        <?php } }?>
   </div>
</div>

my controller Welcome.php file and function of the update
    public function projdetails_update($id)
{
$this->form_validation->set_rules('pcost','Project Cost','numeric');
if($this->form_validation->run()==false)
    {
        $d['m'] = $id;
        $this->load->view('header');
        $this->load->view('updt-project-details',$d);
        $this->load->view('footer');
    }
    else
    {
       $cost = $this->input->post('pcost');
       $imghid = $this->input->get('p');
       if($imghid='')
       {
           // then update null value to image which updated successfully.
       }
        else
        {
            $data = array('img_path'=>implode($this->input->get('p'));
        }
    }
      // then update query which performs correctly.
}

how to take hidden values in an array and store it and then update it.
this is my question.

A:

in updt-project-details.php file code i change as
      $arra = array();
      foreach($f as $key=>$n)
      {
          if($n=='')
           {
                   // updated as null
           }
          else
         {
          <input type="hidden" name="<?php echo 'p_'.$key;?>" value="<?php echo $arra[] = $n;  ?>">   
         }

it store values and i get it in controller.

