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.
You can write your own case insensitive glob. This is from a personal web library I write:
/** PHP has no case insensitive globbing
* so we have to build our own.
*
* $base will be the initial part of the path which doesn't need case insensitive
* globbing.
* Suffix is similar - it will not be made insensitive
* Make good use of $base and $suffix to keep $pat simple and fast in use.
*/
function ciGlob($pat, $base = '', $suffix = '')
{
$p = $base;
for($x=0; $x