My script is in http://localhost/path/test/index.php
and the file I want to delete is in http://localhost/path/media/test.txt
.
I want to have the path of the project as a constant PATH
which would be path/
in this example. So I tried it with the root-relative path unlink("/" . PATH . "media/test.txt")
, which didn't work.
Any ideas how to solve this path problem?