Re: can I do a for each here??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> wrote in message 
news:828f82cb05031704547c60c71@xxxxxxxxxxxxxxxxx
> Difficult to be definitive without seeing your code, but I would be
> tempted by the use of arrays...
>
> cheers 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux