Warning: preg_replace (): The trailing delimiter '/' was not found in C: \ wamp \ www \ upload \ upload_demo.php on line 77 I used preg_replace () to replace the slash with a backslash. But this shows the warning above. Here is the code.
function del_file($file) { $delete = @unlink($file); clearstatcache(); if (@file_exists($file)) { $filesys = preg_replace("/", "\\\\", $file); $delete = @system("del $filesys"); clearstatcache(); if (@file_exists($file)) { $delete = @chmod($file, 0775); $delete = @unlink($file); $delete = @system("del $filesys"); } }
source share