How to unlink multiple files in codeigniter?
I have to delete records from database.
delete records works .
what i want, after deleting records also files should get delete form directory(/uploads/deals/)
My scripts is below:
public function delete($merchant_deals_id)
{
$deal = $this->admin_deal_model->get_single_deal($merchant_deals_id);
$path = './uploads/deals/';
$image1 = $path.$deal['deal_images1'];
$image2 = $path.$deal['deal_images2'];
$image3 = $path.$deal['deal_images3'];
$files = array($image1, $image2, $image3);
$this->admin_deal_model->delete($merchant_deals_id);
$data = array('deals' => $this->admin_deal_model->delete());
$this->session->set_flashdata('deals', '<p>Deals successfully deleted!</p>');
redirect('admin/admin_merchant_deal', $data);
}//delete
sorry for my terrible english