-2

I have a file image with the name :

35210001.jpg

And I want to move the file to another folder. What is the solution to handle the "LIKE" in PHP like Query in MySQL because the filename indicator obtained from the request to move is only :

3521

This is mycode :

$name = "35210001.jpg";
$date = date("YmdHis");
File::move('C:/xampp/htdocs/test/test_media/' . $name, public_path('test_move' . $date . '.jpg')); public_path('test_move' . $date . '.jpg'));
bengbeng
  • 29
  • 3
  • What are you talking about, "LIKE query"? Really unclear what you are trying to ask here. – CBroe Sep 29 '21 at 09:26

1 Answers1

0

What you are looking for is the glob function, here is the doc

Exemple from doc :

foreach (glob("*.txt") as $filename) {
    echo "$filename occupe " . filesize($filename) . "\n";
}
Will
  • 899
  • 8
  • 15