1

So i want to select the image that has -bpfull in name, like this 5ac46ae912feaaf004b2fdb88f1c8a1a-bpfull.png .

I have a lot of images and i want a regex to do it, this is my small code to select images from the folder :

$dir = $upload_dir['basedir'].'/avatars/2/';

so plz if someone has any idea i will be very appreciative.

Mohammed
  • 31
  • 5

1 Answers1

3

You could use phps glob() function

foreach (glob($dir . "*-bpfull.*") as $filename) {
    echo "$filename . "\n";
}
maxhb
  • 8,554
  • 9
  • 29
  • 53