A sample of my associative array is as follows:
// Sets Array
["modern masters 2015"]=>
string(3) "MM2"
["modern masters"]=>
string(3) "MMA"
["mercadian masques"]=>
string(3) "MMQ"
The element that is giving me trouble is "modern masters 2015." Here is a snippet of the code:
$currentSet = "Modern Masters 2015";
$currentSet = strtolower($currentSet);
var_dump($sets[$currentSet]);
When I do var_dump(), it returns NULL only for this particular set. The sets array has over 100 elements, all of which work in the above code EXCEPT "modern masters 2015." However, if I call:
var_dump($sets["modern masters 2015"]);
...it works just fine and returns "MM2" as desired. It's only when I use a variable in between the brackets it returns null (for some odd reason).
What is also weird is that this particular set did not used to be bugged. I speculated that it may have been the integers, but other sets with integers in the name worked perfectly. I'm not too sure what is going on here; some guidance would be appreciated.