关于session数据类型的问题
本帖最后由 natici 于 2015-01-29 11:25:25 编辑
<br />$_SESSION['BACKDOOR']['name'] = 'a';<br />$_SESSION['BACKDOOR']['name'] = array('a' => 'no', 'b' => 'yes'); //Notice: Array to string conversion<br /><br />print_r($_SESSION['BACKDOOR']['name']); //还是输出a,证明第二次赋值没成功。<br />
Copy after login
为什么?有什么方法可以修改session的数据类型吗?
------解决思路----------------------... 我的第二次赋值成功了。。。。
------解决思路----------------------本帖最后由 xuzuning 于 2015-01-29 12:03:24 编辑
$_SESSION['BACKDOOR']['name'] = 'a';<br />$_SESSION['BACKDOOR']['name'] = array('a' => 'no', 'b' => 'yes'); <br />print_r($_SESSION['BACKDOOR']['name']);
Copy after login
Array<br />(<br /> [a] => no<br /> [b] => yes<br />)<br /><br />
Copy after login
没有问题!
你的 php 的版本是多少?
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn