I don't know about DB2, but most libraries will return the rows in the case you specify them in your query, so, you can SELECT USERID
, SELECT userid
or SELECT UserId
, whichever suits you best.
The keys of an array are not case insensitive ever.
It would be possible to write a class that mimics an array (look on PHP.net. you'll have to implement an interface to achieve this). Every value you add to it, can be added to an internal array structure using a lowercase version of the key. When reading a value, you can also use the lowercase version of the specified key. This will essentially make your class behave like a case insensitive array.
A class like this can be used in for-loops too, but unfortunately it cannot be passed to functions that actually require an array parameter.
A different solution: If you have a fairly small amount of queries, and your database layer is nicely separated from the rest of your application, you can apply some sort of translation. Just iterate through the resulting arrays, and map their keys to a specific casing you like, using a translation array. E.g. make an array containing ('lowercase'=>'CamelCase') versions of your field names. That way, you can easily find names and find the right casing for them. Using the found keys, you can construct a new array, before returning it to the requesting code.
Those keys still won't be case insensitive, but they will have the casing you want.