How to delete the specific files and folders that begin and cotains with some numbers and titles?

I came up with this questioin. My background is from the Node.js. I am not usually quite used to be in PHP. That’s why I’m aksing this question to solve the current issues.

The issues is that’s to says I have certain Files and Folders that contains with a specific letters and number at the beginning. As you can see given by down below with a scrrenshot.

enter image description here

I just learn and writing some php code that I grabbed it from the internet resources. Take a look at what’s my code:

  1. I want this to detele this all folders which contains letters “exp_” and all the files names start with this numbers “xx-xx-xx” etc.

  2. I created delete.php. When I’d called this file via the browser, I want to achieve to delete all the files and folder which for the No. 1 case.

  3. All these folders and files are generated in everdays. That’s why I do want to clean all those data.

<?php
$path = "test";

if(!unlink($path)){
 echo "File has not deleted yet.";
} else {
 echo "Successfully deleted!";
}

?>

Is there any how any solution to solve this issues? I will appreciate all in advanced who are giving me idea and suggestions from you guys.