unlink path

I need to delet some files, so I thought of unlink.


Now, I'm confused by the path in the example:

$fh = fopen('test.html', 'a');
fwrite($fh, '<h1>Hello world!</h1>');

mkdir('testdir', 0777);


What is that relative to, where the script is run? Or something else?

I assume I can do this:
unlink($_SERVER['DOCUMENT_ROOT']. '/path_relative_to_document_root') ?



Relevant Pages

  • Re: unlink a dir??
    ... You should report that to PHP. ... because unlink() will remove a directory in most C libraries..permissions being OK.. ... rmdirIIRC merely checks that it is an empty directory. ...
  • permissions problem with unlink()
    ... I am having trouble getting unlink() to work on my local machine ... (win 2000, Apache, php 4.2.2) ... I have looked at and checked the permissions on all the relevant folders via ...
  • Re: Pleas Help Me (File Upload and delete)
    ... I am using Windows Xp using Xamp to run my php application ... while unlink the file i received one error like Access denied in my ...
  • Re: unlink a dir??
    ... Basic unlink() usage: ... because unlink() will remove a directory in most C ... The PHP  manual doesn't actually say at a cursory glance  that unlink ...
  • Re: [PHP] Patterns
    ... On 6/7/07, Steve Marquez wrote: ... If the file ends in .php, then I want it to unlink from a certain folder. ... // Do your unlinkroutine for .htm/.html files here.... ...