<?PHP unlink('test.txt');?>
Since
<?PHP $delfile = "del \"test.txt\""; system($delfile);?>
For Linux:
<?PHP $delfile = "rm \"test.txt\""; system($delfile);?>
<?PHP if (is_dir("dir")) { rmdir("dir"); }?>
Following PHP code can delete all files and subdirectories in a directory recursively.
<?PHP function deldir($dir) { if (is_dir($dir)) { $targ = scandir($dir); foreach ($targ as $item) { if ($item != "." && $item != "..") { $item = $dir . "/" . $item; if (filetype($item) == "dir") deldir($item); else unlink($item); } } rmdir($dir);//delete the empty directory finally } }?>