can a php $_SESSION variable have numeric id thus : $_SESSION['1234’]

后端 未结 3 1279
难免孤独
难免孤独 2020-12-20 23:14

I\'ve been driving myself nuts with this problem.

I\'m creating a session id dynamically in order to retain the page state on refresh.

If a page element is c

3条回答
  •  一个人的身影
    2020-12-20 23:37

    Top level keys in the $_SESSION can't be numeric, but keys on the deeper level can.

    Eg.

    $_SESSION['ids'][13] = $foo;
    $_SESSION['ids'][666] = $bar;
    

提交回复
热议问题