Tutorialsplane

Delete Directory in Codeigniter


Delete Directory in Codeigniter You can use file helper in codeigniter to delete files. Using this helper you can delete files in folder.


Delete Directory in Codeigniter Example

Here in an example of deleting all files in folder-

Delete Directory in Codeigniter Example:

$path = $this->config->base_url().'images';
$this->load->helper("file"); // load the helper
delete_files($path, true); // delete all files/folders inside images folder

It will delete all folders/files inside the images folder.