当前位置:Gxlcms >
PHP教程 >
PHP的session_encode()和session_decode()函数
PHP的session_encode()和session_decode()函数
时间:2021-07-01 10:21:17
帮助过:27人阅读
<无详细内容>
- //boolean session_encode()
- session_register ( 'bgcolor' );
- session_register ( 'fontcolor' );
- $id = session_id ( $usr_id );
- $bgcolor = "white";
- $fontcolor = "blue";
- $usr_data = session_encode ();
- print $usr_data;
- ?>
- session_start();
- $_SESSION = array();
- session_decode( "products|a:2:{i:0;s:8:\"Hal 2000\";i:1;s:6:\"Tardis\";}" );
- foreach ( $_SESSION['products'] as $p ) {
- print "$p
\n"; - }
- ?>
|