title: How to delete the file from the folder in codeigniter?
body: <p>I saved the name of the file in the database and deleted the name form the database but having problem with the folder file.Can you guys please help me out with that.following is my controller function for delete.I first pass the id from the database and delete the file name from database.I also grab the name of the file in array.But how to delete the file.my file location is in root name "mms/musics/".</p>
  
  <pre><code>public function delete($id){
              $this-&gt;load-&gt;model('main');
              $this-&gt;common_model-&gt;delete('id',$id,'audio');
  
  
          foreach($data as $row){
              $data['id'] = $row-&gt;id;
              $data['file_name'] = $row-&gt;audio; 
          }
          redirect($_SERVER['HTTP_REFERER']);
  
  
  
  
          $this-&gt;main-&gt;delete($data);
  
          //$this-&gt;load-&gt;helper("file");
          //delete_files(base_url()."musics/$data['name']");
  
  
      }//delete
  </code></pre>
  
  <p>please guys help me out..</p>