• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array cookie

#1
[eluser]EEssam[/eluser]
From PHP manual:

Example #3 setcookie() and arrays

You may also set array cookies by using array notation in the cookie name. This has the effect of setting as many cookies as you have array elements, but when the cookie is received by your script, the values are all placed in an array with the cookie's name:

<?php
// set the cookies
setcookie("cookie[three]", "cookiethree");
setcookie("cookie[two]", "cookietwo");
setcookie("cookie[one]", "cookieone");

// after the page reloads, print them out
if (isset($_COOKIE['cookie'])) {
foreach ($_COOKIE['cookie'] as $name => $value) {
echo "$name : $value <br />\n";
}
}
?&gt;

How this can be done with CI cookie's library?
http://ellislab.com/codeigniter/user-gui...elper.html

Thanks.


Messages In This Thread
Array cookie - by El Forum - 09-04-2008, 12:22 PM
Array cookie - by El Forum - 09-04-2008, 03:32 PM
Array cookie - by El Forum - 09-04-2008, 04:14 PM
Array cookie - by El Forum - 09-04-2008, 07:04 PM
Array cookie - by El Forum - 09-05-2008, 07:29 AM
Array cookie - by El Forum - 09-05-2008, 07:36 AM
Array cookie - by El Forum - 09-05-2008, 08:16 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.