This article provides a detailed analysis of how to create a Cookie array in PHP. For more information, see
This article provides a detailed analysis of how to create a Cookie array in PHP. For more information, see
Create:
The Code is as follows:
Setcookie ("ICNet [Reg]", "This is reg cookie", time () + 3600 );
Setcookie ("ICNet [Active]", "This is login cookie.", time () + 3600 );
Print_r ($ _ COOKIE );
/* Result:
Array ([ICNet] => Array ([Reg] => This is reg cookie [Active] => This is login cookie) [PHPSESSID] => nsi2q5upuvqrik6notaohjd7p3)
*/
Read:
The Code is as follows:
Echo $ _ COOKIE ['icnet'] ['reg '];
Echo $ _ COOKIE ['icnet'] ['active'];
// Or
$ Arr_cookie = $ _ COOKIE ['icnet'];
Echo $ arr_cookie ['reg '];
Echo $ arr_cookie ['active'];
Destruction:
The Code is as follows:
Setcookie ('icnet [Reg] ', '', time ()-3600 );
Setcookie ('icnet [Active] ', '', time ()-3600 );
, Hong Kong virtual host, server space, Hong Kong Virtual Host