It is ok to use an array key with spaces

I am trying to parse a csv file using a function fgetcsv(), but the CSV file header consists of a value such as E-mail Address'which I need to convert as an array key, but I wonder if it is ok to use a non-standard name for the key?

I would store this value in the database directly, so I'm not sure that getting a value like this $entry['E-mail Address']would be ok

+4
source share
1 answer

A string is a string. The fact that it has a space in the middle should not prevent you from using it as an array key.

+2
source

All Articles