开发者

Reading cookies

When I do:

print_r($_COOKIE[@PATH]);

It returns a nice array:

Array ( ['threads'] => Array ( [12] => Array ( [50] => 1317830223 [1] => 1317785487 [14] => 1317497737 [7] => 1317488004 [9] => 1317485889 [6] => 1317294825 [5] => 1317289974 [4] => 1317288063 ) ) )

But when I do:

print_r($_COOKIE[@PATH]['threads']);

It doesn't print anything... var_dump is also 开发者_运维技巧returning NULL.

Whats wrong with that? First print is saying that there is an array like this, but when I try to catch it, script returning null.


Judging by the looks of your array output, your cookie array contains a key named 'threads', not threads. Those quotes are part of the key name, so somewhere you are adding extraneous quotes to the key.

Try print_r($_COOKIE[@PATH]["'threads'"]); to see what I mean.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜