关于session中的值 s 和i代表什么意思

WBOY
Release: 2016-06-13 10:14:31
Original
1117 people have browsed it

求助关于session中的值 s 和i代表什么意思?
为何打开sessionid里面的信息,发现有的是name|s:4:"gong" 四个参数的表达方法,有的是id|i:3;三个参数的表达方法。大部分是四个参数表达,为何会有三个参数的,而且id|i:3表达的有问题,因为id的值不是3,而是2




------解决方案--------------------
unserialize

name|s:4:"gong"
表示$_SESSION["name"]的值是gong,s表示string,4表示长度
id|i:3,则是$_SESSION["id"],值为3,i表示integer

用unserialize就可以了。
------解决方案--------------------
表示session变量
name|s:4:"gong"
名为 name 类型 字符串 长度 4 值为 gong

id|i:3
名为 id 类型 数值 值为 3

i 数值类型,不需要长度信息

至于最后的疑问,请核实后再说

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!