I want to find some special filenames. Therefore I use glob()
.
$foundResults = glob($directory . '{data_*.csv, log_*.txt}', GLOB_BRACE);
This code only finds my first pattern data_*.csv
. So it seems that an asterisks is not allowed in between the curly brackets?
What are my alternatives? I can only think of using a for each
construct to call glob()
multiple times. Or are there better algorithms/functions?
Correct call without the space characters!
$foundResults = glob($directory . '{data_*.csv,log_*.txt}', GLOB_BRACE);
I got the tip from this topic: help with glob/GLOB_BRACE