if(session_is_registered(username))
{
echo "A session variable by the name \"username\"
already exists";
}
else
{
echo "No variable named \"username\" registered yet.
Registering...";
session_register(username);
}
?>
session_encode() and session_decode():将session数据编码成字符串或将字符串解码成session数据。
在这里你能够利用他们:
<?php
session_start();
session_register('someString');
$someString="I hate cats!";