I'm writing a webpage in php and part of my code is:
$files = scandir( '../www/media/' );
$fileTypes = [
'pdf' => 'text',
'jpg' => 'text',
];
The problem is that if scandir
finds a file that ends in "JPG", because of the case difference it won't be placed in $fileTypes
. Is there a way to ignore the case difference so I don't have to type out the variations for lowercase and uppercase?