I want to delete a file which I only know the first part of the name.
unlink('./upload/nav_thumbs/project-' .the rest);
'the rest' = can be anything. Only thing I got is that is has a .jpg extension
Is there a way to do this?
$possibleFiles = glob('./upload/nav_thumbs/project-*.jpg');
foreach ($possibleFiles as $file) {
if (thisIsTheFileYouAreLookingFor($file)) {
unlink($file);
}
}