Thursday, May 27, 2010

Hyphen in Array keys

Programmer Question

All,



I have an array with hyphens in the key name. How do I extract the value of it in PHP? It returns a 0 to me, if I access like this:



print $testarray->test-key;


This is how the array looks like



 testarray[] = {["test-key"]=2,["hotlink"]=1}


Thanks



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails