unlink works fine with paths.
Description bool unlink ( string
$filename [, resource $context ] )
Deletes filename. Similar to the Unix
C unlink() function. A E_WARNING level
error will be generated on failure.
filename
Path to the file.
In case had a problem with the permissions denied error, it's sometimes caused when you try to delete a file that's in a folder higher in the hierarchy to your working directory (i.e. when trying to delete a path that starts with "../").
So to work around this problem, you can use chdir() to change the working directory to the folder where the file you want to unlink is located.
<?php
$old = getcwd(); // Save the current directory
chdir($path_to_file);
unlink($filename);
chdir($old); // Restore the old working directory
?>