mcgrailm
mcgrailm

Reputation: 17640

php glob does not contain some strings

I have this glob

    $images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);

it gets images in a images directory but some files contain the string "Insert" and "Swatch" and I dont want to return those files.

I've looked around for any example of how to exlude them from the glob but have had no luck

Upvotes: 2

Views: 820

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798726

glob() can't do that. You will need to traverse the result and exclude them yourself.

Upvotes: 2

Related Questions