<?php //session编码 session_start(); $_SESSION['name'] = 'Jack'; $_SESSION['sex'] = 'men'; $envar = session_encode(); echo $envar;//name|s:4:"Jack";sex|s:3:"men"; echo '<br/>'; //session解码 session_decode($envar); echo $_SESSION['name']."-".$_SESSION['sex']; ?>