为什么PHP不允许在$ _SESSION中使用小数值作为根键?
例如......
$paper_num = '159339';
$mark = 'A';
$_SESSION[$paper_num][$mark];
......不起作用。
答案 0 :(得分:1)
你不能把它作为数组保存在会话中,例如......
<?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']);
?>