How do I delete a file, for example: 22.pdf from my server with PHP if the file is in an otheranother directory?
Here is my page layout: projects/backend/removeProjectData.php (this file deletes all my entries for the database and should also delete the related file)
projects/backend/removeProjectData.php(this file deletes all my entries for the database and should also delete the related file)public_files/22.pdf(the place where the file is located.)
I'm using the public_files/22.pdfunlink (the place where the file is located.)function:
Now I'm using the unlink('../../public_files/' . $fileName);
But this always gives me an error that the file does not exist any. Any ideas?