Home >Backend Development >PHP Tutorial >关于session数据类型的问题

关于session数据类型的问题

WBOY
WBOYOriginal
2016-06-23 13:40:09869browse

$_SESSION['BACKDOOR']['name'] = 'a';$_SESSION['BACKDOOR']['name'] = array('a' => 'no', 'b' => 'yes');   //Notice: Array to string conversionprint_r($_SESSION['BACKDOOR']['name']);     //还是输出a,证明第二次赋值没成功。


为什么?有什么方法可以修改session的数据类型吗?


回复讨论(解决方案)

...  我的第二次赋值成功了。。。。

$_SESSION['BACKDOOR']['name'] = 'a';$_SESSION['BACKDOOR']['name'] = array('a' => 'no', 'b' => 'yes'); print_r($_SESSION['BACKDOOR']['name']); 
Array(    [a] => no    [b] => yes)
没有问题!
你的 php 的版本是多少?

此问题其实是不存在的,是我其他地方搞错了。感谢楼上的2位!

Statement:
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