PHP mixes the concept of arrays and the concept of dictionaries (aka hash tables, hash maps, associative arrays) into one array type .
In .NET and most other software environments, arrays are always indexed numerically. For named indexes, use the dictionary instead:
var dict = new Dictionary<string, string> { { "foo", "some foo value" }, { "bar", "some bar value" } };
Unlike PHP associative arrays, dictionaries in .NET are not sorted. If you need a sorted dictionary (but probably not), .NET provides a sorted dictionary type .
Boltclock
source share