PHP - session编码和解码 示例
AndyYang|
阅读:496
发表时间:2020-11-28 20:18:29
php
摘要:PHP - session编码和解码 示例
session_start();
$_SESSION['name'] = 'webyang.net';
$_SESSION['sex'] = 'male';
//session编码
$webyang = session_encode();
echo $webyang;//name|s:11:"webyang.net";sex|s:4:"male";
echo '<br/>';
//session解码
session_decode($webyang);
echo $_SESSION['name']."-".$_SESSION['sex'];
已有1条评论