In my directory there are some files; I want to delete files which just their name is for example: 22, and it makes no difference what are their format !
for example there are these files in directory :
21.pdf
22.doc
22.pdf
22.docx
in normal way I use this code :
$file_name = '22.doc';
if(is_writable(dirname(__FILE__) . '/admin-upload/' . $file_name))
{
unlink(dirname(__FILE__) . '/admin-upload/' . $file_name );
}
but it just delete doc
, now how can I tell to program : Delete all files which their name is : 22 ?