Tuesday, May 1, 2012

Re: cookie and array

you just rephrased your initial post.
and still didnt post the actual code of your problem (only pseudo code which you shouldnt)

also - always cast if you want to to check some key that might be null.

$cookieArray = (array)$this->Cookie->read('key');
if (in_array($value, $cookieArray)) {}


Am Dienstag, 1. Mai 2012 11:42:08 UTC+2 schrieb hoss7:
i want create some cookie for add some array in it and i want add some value in this array and update cookie

in cookie i want have this:
array()
then
array([0]=>1)
then
array([0]=>1,[1]=>2)
then
array([0]=>1,[1]=>2...)

this is my problem
if (in_array(1,cookie array){
echo 'yes';
}

i want have some array in cookie and check some value,this value is product.id and array values is all product.id have user view it,i want chek user only see  this product one time

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: