Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么 PHP 不允许在 $_SESSION 中使用十进制值作为根键?
例如...
$paper_num = '159339'; $mark = 'A'; $_SESSION[$paper_num][$mark];
......不起作用。
你不能将它作为数组保存在会话中,例如..
<?php session_start(); $paper_num = '159339'; $mark = 'A'; $paper_detail = array( 'paper_number'=> $paper_num, 'paper_mark'=> $mark); $_SESSION['paper_details'] = $paper_detail; print_r($_SESSION['paper_details']); ?>