Re: can I do a for each here??

From: Date: Thu, 17 Mar 2005 13:27:26 +0000
Subject: Re: can I do a for each here??
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-210976@lists.php.net to get a copy of this message
Think what I want to do then is create two arrays, one for the values of the age and one for the correponding name e.g. $age = array() // this is the inputed textbox values $name= array('john', 'bob', 'tim') Then I need to assign the the ages to cookie of the persons name by using a for or do-while loop. loop{ if (isset($age[x])){setcookie("cookie[ $name[x] ]", "$age[x]");} else { setcookie("cookie[ name[x] ]", "");} }end loop Any suggestion how I would execute this would be fantactic. Not to worry I can just have 10 lines if need be. AD "Chris Ramsay" <raz.net@gmail.com> wrote in message news:828f82cb05031704547c60c71@mail.gmail.com... > Difficult to be definitive without seeing your code, but I would be > tempted by the use of arrays... > > cheers

« previous php.general (#210976) next »