I have three files which when i click on delete should be removed. How am I able to use the unlink and realpath for my multiple files?
public function delete() {
$path_to_file = FCPATH . 'application/modules/admin/controllers/module' .'/'. $this->uri->segment(5).'.php';
$path_to_file_lang = FCPATH . 'application/modules/admin/language'.'/' .'english' .'/'. 'module/'. $this->uri->segment(5).'lang.php';
$path_to_file_view = FCPATH . 'application/modules/admin/views/template/module' .'/'. $this->uri->segment(5).'.tpl';
if (unlink(realpath($path_to_file), realpath($path_to_file_lang)) ) {
echo "deleted" .' '. $path_to_file;
echo "<br/>";
echo "deleted" .' '. $path_to_file_lang;
echo "<br/>";
echo "deleted" .' '. $path_to_file_view;
} else {
echo "did not delete";
}
}