Hyphen in Array keys

Posted by Vincent on Stack Overflow See other posts from Stack Overflow or by Vincent
Published on 2010-05-27T20:50:37Z Indexed on 2010/05/27 20:51 UTC
Read the original article Hit count: 195

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays