I am trying to check if the instance of a filename exists (despite it's extension) and then delete it. Here is what I have that is not working...
$username = $_POST["data"]["username"];
$mask = '../../files/' . $username . '.*';
if (file_exists($mask))
{
unlink ($mask);
}
Can someone please tell me what I'm doing wrong? I know that the first line is correct because it is being used correctly with other commands. Just not sure about the rest. Using PHP 5.2