title: Remove image from folder after deleting in codeigniter
body: <p>I want to delete the image not only in database, but in folder too.</p>
  
  <p>this is my model</p>
  
  <pre><code>    public function delete($id)
          {
              if ($this-&gt;db-&gt;delete("np_gallery", "id = ".$id)) 
              {
              return true;
              }
          }
  </code></pre>
  
  <p>this is my controller</p>
  
  <pre><code>public function delete_image($id)
  {
      $this-&gt;np_gallery_model-&gt;delete($id);
      $query = $this-&gt;db-&gt;get("np_gallery");
      $data['records'] = $query-&gt;result();
      $this-&gt;load-&gt;view('admin/gallery/gallery_listing',$data);
  }
  </code></pre>
  
  <p>this is my view</p>
  
  <pre><code>&lt;table class="table table-bordered"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Sl No&lt;/td&gt;
                      &lt;td&gt;Tag&lt;/td&gt;
                      &lt;td&gt;Image&lt;/td&gt;
                      &lt;td&gt;Action&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
  
              &lt;?php 
              $SlNo=1;
                  foreach($records as $r)
                  {
               ?&gt;
                  &lt;tbody&gt;
                      &lt;tr&gt;
                      &lt;?php $image_path = base_url().'uploads';?&gt;
                       &lt;td&gt;&lt;?php echo $SlNo++ ; ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $r-&gt;tag; ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;img src="&lt;?php echo $image_path; ?&gt;/images/gallery/&lt;?php echo $r-&gt;picture;?&gt;" style=" width:35%; height:100px;"/&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;a href="&lt;?php echo site_url() . "/np_gallery/select_content/". $r-&gt;id?&gt;" class="fa fa-pencil"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
                           &lt;a href="&lt;?php echo site_url() . "/np_gallery/delete_image/". $r-&gt;id?&gt;" onClick="return confirm('Are you sure want to delete')" class="fa fa-trash"&gt;&lt;/a&gt;&lt;/td&gt;   
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;?php } ?&gt;
          &lt;/table&gt;
  </code></pre>
  
  <p>I succeed in deleting the data in the database, but the image in the folder are not also be deleted.</p>