You are here: Re: [PHP] can I do a for each here?? « PHP « IT news, forums, messages
Re: [PHP] can I do a for each here??

Posted by AndreaD on 03/17/05 15:27

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация