I want all CSV files in a directory, so I use
glob('my/dir/*.CSV')
This however doesn't find files with a lowercase CSV extension.
I could use
glob('my/dir/*.{CSV,csv}', GLOB_BRACE);
But is there a way to allow all mixed case versions? Or is this just a limitation of glob()
?
glob() is case sensitive in Linux, but case insensitive in Windows.
Definition and Usage The glob() function returns an array of filenames or directories matching a specified pattern.
Glob patterns support character ranges:
glob('my/dir/*.[cC][sS][vV]')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With