0

I'd like to delete (unlink) files from a directory like this: .name.ico , but the "name" can be anything else. I tried the .*.ico like this:

unlink("dir1/dir2/.*.ico");

but it is not successfull.

If in the code I write the correct filename like this:

unlink("dir1/dir2/.name.ico");

the procedure is succesfull! But I dont know always what is the "name" exactly, I have to masked "name" to "*"

I would like to ask for help in resolving this.

Thank you very much!

Hoppo
  • 1,130
  • 1
  • 13
  • 32

1 Answers1

0

I used this as a solution:

$icofilename = (glob("dir1/dir2/.*.ico"));
unlink($icofilename[1]);
Zak
  • 6,976
  • 2
  • 26
  • 48