I’m working with a long list of name – value pairs and I will be checking with this list alot so I wanted to know what you guys think is the fastest way to do named value pair look ups. An example of my problem is as follows:
Using PHP
The variables are on the left side with the string value they are suppose to represent. There are roughly 68 variable with corresponding string values.
rKid = Hiking
rSpo = Sports
rFly = Flying
I will need a look up every web page to see what each of the variables could correspond to.
I was thinking of an array -> list value look up, but unsure of how to implement that.
Associative arrays in PHP are in fact hash maps, so lookup by key is very efficient. What you need is this structure:
And the lookup is straightforward: