取消链接不与文件夹名称路径中的句点(.dot)一起使用

Problem:

unlink() is not working with a period . in the foldername path. It works without a period in the path though.

What I have tried:

I tried the escaping method. no luck.

$imagetodelete = $_GET['imagetodelete'];
$delete = $_GET['delete'];

if ($delete == "yes") {
error_reporting(E_ALL); #ini_set('display_errors', 1);



$dir = ('/var/www/example.com/pictures.gif.collection/');

directory

$dir = str_replace(".", "\\.", $dir);

and

$dir = str_replace(".", "\.", $dir);

I combined them into $filepath

 $filepath = "/www/example.com/pictures.gif.collection/$imagetodelete";
 unlink($filepath);
}

errors are Permission denied (if directory name has dots makes no sense) php script, file to delete, and folder are all set to 777

the above only works if
$filepath = "/www/example.com/picturesgifcollection/image.jpg"; (no dots)

I also tried:
unlink not working with space in foldername path

i posted this before, the answer was permissions.. i set it to full root and it worked

thanks to Dragon genius