Create a Cookie array based on PHP. Create: Copy the code as follows: setcookie (ICNet [Reg], thisregcookie, time () + 3600); setcookie (ICNet [Active], Thisislogincookie ., time () + 3600); print_r ($ _ COOKI
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 );
The response code is as follows: setcookie ("ICNet [Reg]", "This is reg cookie", time () + 3600); setcookie ("ICNet [Active]", "This is login cookie. ", time () + 3600); print_r ($ _ COOKI...